Skip to content

Update to work better with Yoast SEO #4

@wpscholar

Description

@wpscholar

At the moment, this plugin only adds a noindex robots meta tag. However, the Yoast SEO plugin also outputs a robots meta tag.

If Yoast SEO isn't blocking indexing for a page where a user of our plugin has checked the "Block search engines" box, we should override the Yoast SEO setting using the wpseo_robots hook:

add_filter(
	'wpseo_robots',
	function ( $value ) {
		if ( /* Perform check */ ) ) {
			return 'noindex,follow';
		}

		return $value;
	}
);

We should, however, respect the Yoast SEO nofollow rule if set. At the moment, we default to follow.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions