WordPress filter hook · part of WordPress core

wp_robots

A WordPress core filter that 20 plugins also fire themselves, running on 31K+ sites between them.

“This filter is documented in wp-includes/robots-template.php”

How to use wp_robots

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_robots', function( $robots ) {
	// Change $robots here.
	return $robots;
}, 10, 1 );

Argument names come from LinkMesh: Semantic AI Internal Links for SEO's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

20 plugins that fire wp_robots

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. ThinkRank SEO icon ThinkRank SEO20,000+ installs apply_filters( 'wp_robots', [] ) includes/frontend/class-seo-manager.php:1433
  2. Nexter Extension icon Nexter Extension10,000+ installs apply_filters( 'wp_robots', array() ) include/panel-settings/extensions/content-seo/class-seo-robots.php:158
  3. LLM Markdown icon LLM Markdown800+ installs apply_filters( 'wp_robots', [] ) includes/class-plugin.php:630
  4. LinkMesh: Semantic AI Internal Links for SEO icon LinkMesh: Semantic AI Internal Links for SEO90+ installs apply_filters( 'wp_robots', $robots ) modules/llms-txt/class-ailm-llmstxt-generator.php:538
  5. Ostheimer SEO icon Ostheimer SEO50+ installs apply_filters( 'wp_robots', array() ) src/Frontend/Robots.php:48
  6. Stedica SEO icon Stedica SEO10+ installs apply_filters( 'wp_robots', [] ) includes/class-head-output.php:952
  7. Schema Markup for Medical Business icon Schema Markup for Medical Business10+ installs apply_filters( 'wp_robots', array() ) src/Schema/PageContextResolver.php:91
  8. Noshi-Kanamer icon Noshi-KanamerFewer than 10 installs apply_filters( 'wp_robots', array() ) noshi-kanamer.php:843
  9. AriSEO icon AriSEOFewer than 10 installs apply_filters( 'wp_robots', array() ) includes/class-ariseo-headless.php:345
  10. Baza Helper icon Baza HelperFewer than 10 installs apply_filters( 'wp_robots', array() ) includes/admin/admin-bar.php:80
  11. TamRank SEO icon TamRank SEOFewer than 10 installs apply_filters( 'wp_robots', array() ) tam-rank.php:1649
  12. Contentrain Bridge icon Contentrain BridgeFewer than 10 installs apply_filters( 'wp_robots', array() ) includes/class-contentrain-bridge-seo.php:236
  13. Multipify SEO Boost icon Multipify SEO BoostFewer than 10 installs apply_filters( 'wp_robots', [] ) includes/class-v53-monitoring.php:169
  14. Gonzales AI Agent Markdown icon Gonzales AI Agent MarkdownFewer than 10 installs apply_filters( 'wp_robots', array() ) includes/Eligibility.php:16
  15. Anand Bajrangi SEO icon Anand Bajrangi SEOFewer than 10 installs apply_filters( 'wp_robots', array() ) src/SEO/CanonicalModule.php:57
  16. WGD SEO icon WGD SEOFewer than 10 installs apply_filters( 'wp_robots', array() ) src/Robots/Robots_Service.php:206
  17. Staging Shield icon Staging ShieldFewer than 10 installs apply_filters( 'wp_robots', array( 'index' => true, 'follow' => true ) ) includes/class-sshield-autoprueba.php:352
  18. Livada SEO Lite icon Livada SEO LiteFewer than 10 installs apply_filters( 'wp_robots', $seed ) includes/class-meta.php:368
  19. Site Current icon Site CurrentFewer than 10 installs apply_filters( 'wp_robots', [] ) includes/class-aifq-sr-next-search-visibility-evidence-producer.php:46
  20. CannyForge Hreflang icon CannyForge HreflangFewer than 10 installs apply_filters( 'wp_robots', array(), 'index' ) includes/class-cannyforge-hreflang-repository.php:372

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.