Support » Plugin: Site Offline or Coming Soon » Suggestion: Return a 503 HTTP status code when site offline

  • Resolved David Rowe

    (@ctrlaltdavid)


    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/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Suggestion: Return a 503 HTTP status code when site offline’ is closed to new replies.