Home Forums WoodMart support forum Return Status code 403 forbidden for maintenance mode

Return Status code 403 forbidden for maintenance mode

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #594105

    av_admin_1984
    Participant

    Hello

    In maintenance mode, now return status code 200 witch is so bad for SEO!
    it must be 403 , and ask for login credential. (the login is not important, but 403 status is highly important)

    Is it possible to solve that?

    Thanks

    #594134

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards

    #594456

    av_admin_1984
    Participant

    Hello

    Thanks for reply
    It was just bug report, noting els
    Just test on your side, put the site in maintenance mode, and see the status code

    Thanks

    #595372

    Hello,

    Sorry for the late reply.

    The maintenance mode has always worked this way for us, but if it doesn’t suit your needs, we can provide you with custom code that you’ll need to add to the functions.php file in your child theme.

    add_action( 'template_redirect', function () {
    	if ( ! woodmart_is_maintenance_active() ) {
    		return;
    	}
    
    	global $post;
    
    	$page_id = current( woodmart_pages_ids_from_template( 'maintenance' ) );
    
    	if ($post->ID == $page_id) {
    		http_response_code( 403 );
    	}
    }, 10 );

    Best Regards.

    #595585

    av_admin_1984
    Participant

    Hello
    that code is working
    Thanks

    #595669

    Most Welcome!!!.

    I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.

    We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Return Status code 403 forbidden for maintenance mode’ is closed to new replies.