From a84270a1b0a0be1eb39d02203f17487aeddb5664 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Thu, 24 Aug 2023 20:48:40 +0000 Subject: [PATCH] Customizer: use the correct `X-Robots-Tag` header. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix an issue where the `X-Robots` header was used instead of the `X-Robots-Tag` header. Using `X-Robots-Tag` yields the correct behavior that the original code intended to add. `X-Robots` is left in place for backward compatibility. Props michelleblanchette, dhruvishah2203, rajinsharwar, jorbin, hztyfoon, elrae.  Fixes #58865. git-svn-id: https://develop.svn.wordpress.org/trunk@56462 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-manager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 4f8aae8fbd..77176609bc 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -1909,6 +1909,7 @@ final class WP_Customize_Manager { if ( ! headers_sent() ) { nocache_headers(); header( 'X-Robots: noindex, nofollow, noarchive' ); + header( 'X-Robots-Tag: noindex, nofollow, noarchive' ); } add_filter( 'wp_robots', 'wp_robots_no_robots' ); add_filter( 'wp_headers', array( $this, 'filter_iframe_security_headers' ) );