Home › Forums › Legacy Support › Support queries › Other issues › Error 5XX Server
- This topic has 12 replies, 2 voices, and was last updated 3 years, 6 months ago by Anshuman Sahu.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
May 4, 2021 at 9:59 am #355884RaphSpectatorHello, I have a huge issu. All my unit are in no index and google see them at error 5XXX server. Or it should be respond in 401 (no authorization to access the document) or in 410 with a noindex Please how I can fix it ? It destroys my SEO so please thank you to look a it.May 4, 2021 at 10:02 am #355885RaphSpectatorThis reply has been marked as private.May 5, 2021 at 2:21 pm #356109Anshuman SahuKeymasterWell units in wplms are not accessible as they contain paid content . Exposing them will make the visitors see the paid content for free .May 6, 2021 at 7:37 am #356234RaphSpectatorYes I understand that, I excluded them from the search, by not referencing them. They are not in the index either, but google still sees them in error 5XXX. I asked the google develloper, and normally this page should have a 401 or 410 code. How do I fix this? Thank you. Because it harms my SEO.May 7, 2021 at 1:52 pm #356523Anshuman SahuKeymasterWell if its not in indexing then how the google has indexed it? I guess it might take some time for google to remove indexes .May 10, 2021 at 8:38 am #356765RaphSpectatorIs not for the indexing but for a incorrect code. It says error server, but is not. Is just a private document. So How I can fix it ?May 11, 2021 at 2:54 pm #356959Anshuman SahuKeymasterWell this should be handled with the help of robots.txt file by adding restriction to /unit url prefix . Neither the bots will crawl this prefix nor this error will show . in robots.txt you can add this :
User-agent: * Disallow: /unit
May 12, 2021 at 1:03 pm #357054RaphSpectatorThis reply has been marked as private.May 13, 2021 at 1:43 pm #357200Anshuman SahuKeymasteryes but where is this line :
which prevents units to be crawled in first place by search engines . there wont be any issues with your seo then . Units are restricted with Page status 500 , we are using wordpress wp_die function to restrict the units and it sends 500 status code .User-agent: * Disallow: /unit
May 18, 2021 at 1:33 pm #357940RaphSpectatorThis reply has been marked as private.May 20, 2021 at 2:02 pm #358309Anshuman SahuKeymasterplease try adding this given code in your wplms-customizer.php file in wplms customizer plugin :add_action('init',function(){ if(class_exists('WPLMS_Actions')){ $ac = WPLMS_Actions::init(); remove_action( 'template_redirect',array($ac,'vibe_check_access_check'),11); } add_action( 'template_redirect','vibe_check_access_check22',11); }); function vibe_check_access_check22(){ if(!is_singular(array('unit','question'))) return; $flag=0; global $post; $free=get_post_meta(get_the_ID(),'vibe_free',true); if(vibe_validate($free) || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && is_user_logged_in())){ $flag=0; return; }else $flag = 1; if(current_user_can('edit_posts')){ $flag=0; $instructor_privacy = vibe_get_option('instructor_content_privacy'); $user_id=get_current_user_id(); if(isset($instructor_privacy) && $instructor_privacy && !current_user_can('manage_options')){ if($user_id != $post->post_author) $flag=1; } } if($post->post_type == 'unit'){ $post_type = __('UNITS','vibe'); }else if($post->post_type == 'question'){ $post_type = __('QUESTIONS','vibe'); } $message = sprintf(__('DIRECT ACCESS TO %s IS NOT ALLOWED','vibe'),$post_type); $flag = apply_filters('wplms_direct_access_to'.$post->post_type,$flag,$post); if($flag){ wp_die($message,$message,array('back_link'=>true,'response'=>400)); } }
May 21, 2021 at 12:03 pm #358468RaphSpectatorWill the response code for google bots be 400? I need them to answer 401? How can I test the code to see if it works? Thank youMay 22, 2021 at 1:32 pm #358655Anshuman SahuKeymasterfor response code 401 please change this line : wp_die($message,$message,array('back_link'=>true,'response'=>400)); to :
To test this you can simply access a not free unit as a visitor (non logged in user ) . You can see status code in chrome developer tools : https://mkyong.com/computer-tips/how-to-view-http-headers-in-google-chrome/wp_die($message,$message,array('back_link'=>true,'response'=>401));
-
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘Error 5XX Server’ is closed to new replies.