Making WordPress.org

Changeset 10674


Ignore:
Timestamp:
02/16/2021 03:38:50 AM (4 years ago)
Author:
dd32
Message:

Login: Don't noindex the front login.wordpress.org page.

Fixes #5530.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r10030 r10674  
    197197add_filter( 'index_template_hierarchy', 'wporg_login_filter_templates' );
    198198
    199 // Don't index login/register pages.
    200 add_filter( 'wporg_noindex_request', '__return_true' );
     199// Don't index login/register sub-pages.
     200add_filter( 'wporg_noindex_request', function( $noindex ) {
     201
     202    // Don't no-index the front page, see https://meta.trac.wordpress.org/ticket/5530
     203    if ( '/' === $_SERVER['REQUEST_URI'] ) {
     204        return $noindex;
     205    }
     206
     207    // noindex it.
     208    return true;
     209} );
    201210
    202211// No emoji support needed.
Note: See TracChangeset for help on using the changeset viewer.