Prevent robots on page outside of wordpress?
-
I have a php page outside of wordpress that loads the header from wordpress to give the same visual look. Google is complaining that php pages breadcrumbs are bad because “Either “name” or “item.name” should be specified” and they give the example as:
{"@type":"ListItem","position":2,"name":""}]
. But really for this page it can have<meta name='robots' content='noindex, nofollow' />
. I think it’s Yoast that is outputting<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />
which is right above the comment that this site is optimized with Yoast SEO plugin v17.1. So in that page I tried adding the add action below therequire_once(DIR_ROOT.'/wp-load.php');
:add_action('wp_head', 'norobots', 0); function norobots() { echo ("<meta name='robots' content='noindex, nofollow' />"); }
But now it just ends up with two robot meta data items, the one above is first, followed by the one mentioned earlier:
<meta name='robots' content='noindex, nofollow' /><meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />
How can I either fix the breadcrumb to work for those type of pages, or fix it for that given page (again, it’s not in word press), or turn it off for that page, or tell the search engines to not bother with this page?
Thanks!
- The topic ‘Prevent robots on page outside of wordpress?’ is closed to new replies.