Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function add_security_headers() {
* Add headers to REST API responses
*/
public function add_rest_api_headers($response) {
$response->header('X-Robots-Tag', 'noindex, nofollow');
if ($response instanceof WP_REST_Response) {
$response->header('X-Robots-Tag', 'noindex, nofollow');
}
return $response;
}

Expand Down