WordPress Plugin: Disable WP Robots

WordPress 5.7 features a new Robots API that provides filter-based control over the robots meta tag. So if your site is running WordPress 5.7 or better, you will notice a new <meta> tag included in the <head> section of your web pages. By default, the meta tag added by WordPress has a value of max-image-preview:large, which is fine IF it is the only robots meta tag on the page. If your site already has its own meta robots tag, then […]


This content originally appeared on Perishable Press and was authored by Jeff Starr

Disable WP Robots WordPress 5.7 features a new Robots API that provides filter-based control over the robots meta tag. So if your site is running WordPress 5.7 or better, you will notice a new <meta> tag included in the <head> section of your web pages.

By default, the meta tag added by WordPress has a value of max-image-preview:large, which is fine IF it is the only robots meta tag on the page. If your site already has its own meta robots tag, then there will be duplicate tags, which is dubious at best. Ideally for optimal SEO, you want only ONE robots meta tag on each page.

5-second summary: Want to disable the meta robots tag added by WordPress? Get the free plugin. More details provided in the article below.

Check your pages

After WordPress 5.7 is released, check the source code of your site’s web pages. On each page you will find the new meta robots tag added by WordPress. Here is a screenshot of what to look for:

Screenshot of robots meta tag added by WordPressNew robots meta tag, replete with single quotes (click image to view full-size)

Now search for any duplicate meta robots tags on the page. If you’re using a plugin to add proper meta tags, or if they are added via your theme template, you may find multiple instances of the meta robots tag. Here is a screenshot showing an example of duplicate robots tags, each specifying a different content value:

Screenshot showing duplicate robots meta tagsShowing duplicate robots meta tags on the page (click image to view full-size)

From what I’ve read, multiple/duplicate meta robots tags on the same page should be avoided. Best case scenario the client properly combines and interprets the different values. Worst case scenario the client misinterprets and something goes awry.

How to disable the WP robots tag

Thanks to the WP team, there is an easy way to disable the meta robots tag that’s added by WordPress. Simply include the following line of code in your theme (or child theme), or include via simple custom plugin:

remove_filter('wp_robots', 'wp_robots_max_image_preview_large');

Save changes and done. When the above line is included, WordPress will not add a meta robots tag to any of your pages. Any meta tags that are added via plugins or themes will not be affected by the above code. Learn more about how it works.

OR..

If you would rather skip messing with code and just use a plugin instead. You can download my plugin Disable WP Robots from its home at the WP Plugin Directory.



This content originally appeared on Perishable Press and was authored by Jeff Starr


Print Share Comment Cite Upload Translate Updates
APA

Jeff Starr | Sciencx (2021-03-01T23:15:17+00:00) WordPress Plugin: Disable WP Robots. Retrieved from https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/

MLA
" » WordPress Plugin: Disable WP Robots." Jeff Starr | Sciencx - Monday March 1, 2021, https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/
HARVARD
Jeff Starr | Sciencx Monday March 1, 2021 » WordPress Plugin: Disable WP Robots., viewed ,<https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/>
VANCOUVER
Jeff Starr | Sciencx - » WordPress Plugin: Disable WP Robots. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/
CHICAGO
" » WordPress Plugin: Disable WP Robots." Jeff Starr | Sciencx - Accessed . https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/
IEEE
" » WordPress Plugin: Disable WP Robots." Jeff Starr | Sciencx [Online]. Available: https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/. [Accessed: ]
rf:citation
» WordPress Plugin: Disable WP Robots | Jeff Starr | Sciencx | https://www.scien.cx/2021/03/01/wordpress-plugin-disable-wp-robots/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.