Thought this was a great question so I went digging. In default-filters.php on line 208 there’s add_action('wp_head', 'noindex', 1);
as of WordPress 4.1. The noindex() function in turn checks to see if you have set blog_public option to 0. If you have, it calls wp_no_robots() which is simply:
function wp_no_robots() {
echo "<meta name="robots" content="noindex,follow" />\n";
}
Neither of last methods are filterable, but a simple plugin will do the trick to remove the hook:
/*
* Declare plugin stuff here
*/
remove_action('wp_head','noindex',1);
Now, you’re free to hook your own action on to echo out what you want.
add_action('wp_head', 'my_no_follow', 1);
function my_no_follow() {
if ( '0' == get_option('blog_public') ) {
echo "<meta name="robots" content="noindex,nofollow" />\n";
}
}
Related Posts:
- Setting up robots.txt with Yoast’s Seo plugin
- Robots.txt not updating
- Disallow author with robots.txt
- robots.txt Not Updating
- How to solve Robots.txt problem with WordPress fresh install?
- how to 301 redirect from a plugin folder
- Force meta data on specific product type
- How to remove WordPress Virtual Robots.txt that keeps overriding my root robots.txt? [closed]
- How to dissallow all wordpress posts in robots.txt?
- Remove Noindex?
- WordPress Embed Page no-index meta data missing
- Anchors in WordPress not followed/ indexed in sitemap.xml
- Not Being Indexed by Search Engines [closed]
- Hide my staging subdomains from search results without impacting the visibility of the root domain
- Adding rel=”next” & rel=”prev” for paginated archives
- How do I set up a custom URL shortener for my posts?
- A plugin for having rel=”nofollow” in posts?
- Why does the header set X-Robots-Tag apply to all pages?
- Preventing Search Engines Indexing Pages 2, 3 and More?
- SEO – Two WordPress websites on same domain name
- add post content in meta description in yoast
- Migrating from other CMS to WP – losing SEO juice?
- Blog not indexed [closed]
- Duplicate Australian E-Commerce site
- What does short_ping do?
- Seo WordPress Pages on google [closed]
- Change Site Title and Description html tags if not home page
- How to noindex nofollow custom post type?
- Set different Canonical url programmatically for every post
- What does it mean by “Home page / Archives” in JetPack Site Stats? [closed]
- Set noindex page-comment from Pages 2, 3 and More?
- Will using REST API impact SEO? [closed]
- Removing rel=”nofollow” from links posted in Post Content
- is it good to use WordPress in the same url extension in terms of seo?
- Yoast SEO: title tags are repeating my website name and slogan [closed]
- How to ensure that a landing page created with WordPress does not enter the sitemap?
- How may I see all the pages on my wordpress website and see when they were created?
- Reactjs headless WordPress theme configure SEO
- install robots.txt to wordpress website admin
- SEO optimization gone not so well
- Automatic SEO for wordpress [closed]
- Why does do_robots() Allow: /wp-admin/admin-ajax.php by default?
- How to hide sensitve page from google spiders and non-membres in wordpress!
- Custom Canonical URLs
- ASCII titles with Yoast SEO plugin
- What is/are the best thing(s) I can do to make my WordPress blog more popular? [closed]
- how to set title of each page or post for SEO
- Search Engine Visibility checkbox after indexed
- best way to stop this wordpress duplicate content
- Why is Google Search Console getting X-Robots-Tag noindex?
- Embed sitemap in a page
- charset problem in wordpress because of nginx config
- Is Shared server effect SEO
- wp_strip_all_tags [closed]
- How to stop showing my under development site on Google Search [closed]
- Updating old website links to new website links [closed]
- Search results show a different site [closed]
- Fix description of website on Google Search result
- SEO is not working on pages [closed]
- Google isn’t able to search my website
- Pinging or sitemap plugin: which practice is better
- How do I create custom tags for WordPress SEO? [closed]
- The inner mechanism of WP SEO plugins
- Does having two installations of WordPress negatively affect SEO? [closed]
- Maintain SEO of a website while migrating it to WordPress?
- WordPress Meta Title Separator
- Yoast SEO plugin – Sitemap links greyed out & page priority
- Customizing SERP content for WordPress Blog
- auto generated robots.txt problem
- Pages and posts with Rel Canonical issues across entire site
- I have redesigned a website and my blog page has different permalinks
- WordPress site for increase SEO ranking in other e-commerce store
- Unlimited false pages showing in Sitemap?
- How can I noindex my archive pages?
- Why are some user agents still getting a meta robots tag with noindex from my site?
- How to add blog in default WordPress post type for SEO standard rule?
- Metatag Discription on site [closed]
- Not sure if to keep this or not (noindex question)
- mobile usability issues with /wp-content/uploads/ folders
- Change WordPress url for newly formed posts or pages
- OpenGraph descriptions not showing when using WordPress SEO (Yoast)
- Best Way To Structure 3 Tiered Site
- deeplink juggernaut – remove settings
- How to make certain content of the post noindex and no follow. not entire post?
- special XML to wordpress posts
- Automatically set posts to NoIndex depending on category?
- wordpress theme: on site seo [closed]
- Tagline showing instead of meta description!
- How to view the code for a certain page?
- Disallow /cgi-bin or not? [closed]
- Dispise all efforts, open graph is a total mess
- Google Tag Manage – to use or not to use
- Multiple Domains Same Install Different Static Pages
- Post title not output correctly
- How to Make your Category Titles have H1 tags?
- Can I delete the redirection in WordPress after switching URLs manually?
- What purpose does /embed/ URL have and how to avoid SEO problems?
- If a landing page is my home page, and it shouldn’t contain navigation links, then how should it lead to other pages? [closed]
- How to improve WordPress website SEO and traffic, and or fix SEO issues
- How to fix Links do not have descriptive text PageSpeed Insights