[wp-trac] [WordPress Trac] #20037: Introduce 'noindex' filter for robots meta tag
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 14 05:01:38 UTC 2012
#20037: Introduce 'noindex' filter for robots meta tag
---------------------------+-----------------------------
Reporter: MartyThornley | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version:
Severity: normal | Keywords: needs-patch
---------------------------+-----------------------------
As things are right now, themes and plugins add robots meta tag lines by
just adding an action to wp_head, with no way of knowing who has added
what. Because it is not done as a filter, there is no way to prioritize or
alter things.
As far as I can see there are two functions that are hooked to wp_head to
add the meta tag for robots, the noindex() and wp_no_robots() function in
'/wp-includes/general-template.php'. All noindex() does is look to see if
a blog is marked private, then calls wp_no_robots(). In other places, like
the signup and login pages, wp_no_robots is manually added.
To help clear up the confusion, we could just call wp_no_robots whenever
we need to add a robots meta tag, use wp_no_robots to do some default
logic, then allow plugins to filter it depending on where we are.
Working on a quick patch now and will add.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20037>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list