[wp-trac] [WordPress Trac] #16893: Stop or reduce crawling of comment reply ?replytocom URLs

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 6 21:14:40 UTC 2011


#16893: Stop or reduce crawling of comment reply ?replytocom URLs
------------------------------------+------------------------------
 Reporter:  joelhardi               |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Comments                |     Version:  3.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------

Comment (by joelhardi):

 Thanks, I agree about it being too low in the stack, I just couldn't think
 of a better way.

 I looked for someplace obvious to add a filter and didn't see one, and
 didn't know what filter to add or about !__return_zero (how useful!). So
 you have solved 95% of it!

 I had thought that, to group the filter addition with the other replytocom
 code, it would have to go into one of the functions in comment-
 template.php unless there was a more serious refactor. 'replytocom' is
 just a magic string in that file and there are about 3 funcs doing
 branches on `isset($_GET['replytocom'])`.

 The problem is that none of these functions is called until after
 wp_head() so that doesn't work.

 It would definitely work to put it in default-filters.php but then it's
 even lower in the stack. Could put the replytocom check in a new function
 and hook it to wp_head, but don't think that's better since it adds
 overhead and is basically equivalent to how noindex() is called.

 Could make replytocom into a public query var, and then add a filter to
 'query_vars' or similar so that it's called inside class WP when the
 request is parsed.

 Anyway, those are my ideas, somebody like you who knows the code 10x
 better may have a much better one.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16893#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list