From 228c60a2221ed8d84215b32dd9ef9e7deda1b636 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 16 Jun 2016 14:59:28 +0000 Subject: [PATCH] REST API: Include X-Robots-Tag: noindex header in REST API responses to prevent endpoints from being indexed by search engines. Prevent duplicate content issues with search engines and REST API endpoint response data. Fixes #36390. Props m_uysl for the initial patch. Built from https://develop.svn.wordpress.org/trunk@37726 git-svn-id: http://core.svn.wordpress.org/trunk@37692 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 75b3388bf4..12e4086bbc 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -226,6 +226,7 @@ class WP_REST_Server { public function serve_request( $path = null ) { $content_type = isset( $_GET['_jsonp'] ) ? 'application/javascript' : 'application/json'; $this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) ); + $this->send_header( 'X-Robots-Tag', 'noindex' ); /* * Mitigate possible JSONP Flash attacks. diff --git a/wp-includes/version.php b/wp-includes/version.php index 4dcc0fb126..e832b8074d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37724'; +$wp_version = '4.6-alpha-37726'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.