WordPress.org

Ready to get started?Download WordPress

Forums

Site Offline or Coming Soon
[resolved] Suggestion: Return a 503 HTTP status code when site offline (2 posts)

  1. David Rowe
    Member
    Posted 1 year ago #

    Thank you very much for this plugin.

    When you set the site offline it would be preferable for an HTTP 503 Service Unavailable status code to be returned to the browser instead of HTTP 200 OK. Doing this would signal to Web search indexers such as Google that they should skip reindexing your site at present, i.e., not to index your "site offline" page. Could also be useful to set the Retry-After value.

    For example, update function cp_siteoffline_message() to read ...


    function cp_siteoffline_message()
    {
    $options = get_option('sp_siteoffline_options');
    if ( $options['enabled'] === false ) return;
    if ( !current_user_can('edit_posts') ){
    header('HTTP/1.1 503 Service Unavailable');
    header('Retry-After: 3600');
    echo $options['content'];
    exit();
    }
    }

    http://wordpress.org/extend/plugins/site-is-offline-plugin/

  2. wpecommerce
    Member
    Plugin Author

    Posted 6 months ago #

    Hi, thanks for the feedback. We just fixed it in the plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.