Support Log in

18. Robots Meta

Developer Guide
Prefer video? Watch the Rank Forge tutorials 9 short guides covering every feature Watch

Per-post, per-taxonomy, and per-archive noindex/nofollow control via the HTML tag. FREE feature.

How It Works

RANKFORGE_Robots_Meta filters WordPress core’s wp_robots directives instead of printing a second robots tag. It evaluates the current page and merges Rank Forge visibility settings into the single core output:
  • Singular pages: reads _rankforge_noindex and _rankforge_nofollow from post_meta
  • Category/tag/taxonomy archives: reads from term_meta
  • Post type archives: reads from rankforge_archive_robots option

If neither is set, Rank Forge leaves the page indexable. Existing core directives still win: when WordPress Settings > Reading > Discourage search engines from indexing this site sets blog_public = 0, the final robots output remains noindex, nofollow regardless of Rank Forge per-post defaults.

Programmatic Control

php
$post_id = 42;

// Set noindex on a specific post
update_post_meta( $post_id, '_rankforge_noindex', '1' );
update_post_meta( $post_id, '_rankforge_nofollow', '1' );

// Check via public API
$is_noindex = RANKFORGE_Robots_Meta::is_noindex( $post_id );

// Taxonomy term robots control
$term_id = 15;
update_term_meta( $term_id, '_rankforge_noindex', '1' );

// Post type archive robots control
$archive_robots = get_option( 'rankforge_archive_robots', [] );
$archive_robots['product'] = [ 'noindex' => true ];
update_option( 'rankforge_archive_robots', $archive_robots );
php
// Bulk operations: noindex all posts with a specific tag
$tag_posts = get_posts( [
    'tag'            => 'deprecated',
    'posts_per_page' => -1,
    'fields'         => 'ids',
] );

foreach ( $tag_posts as $pid ) {
    update_post_meta( $pid, '_rankforge_noindex', '1' );
}

Forge AI Assistant Online

Hi! I'm the Rank Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs