[wp-trac] [WordPress Trac] #63467: function do_robots() should use admin_url() a
WordPress Trac
noreply at wordpress.org
Tue May 20 14:59:49 UTC 2025
#63467: function do_robots() should use admin_url() a
-------------------------------------+-----------------------------
Reporter: Hrohh | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Privacy | Version: 6.8
Severity: normal | Keywords:
Focuses: administration, privacy |
-------------------------------------+-----------------------------
Dear all,
we have /wp-admin/ hardcoded in do_robots() function. How can i use filter
admin_url('admin-ajax.php') ?
{{{#!php
<?php
$site_url = parse_url( site_url() );
$path = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] :
'';
$output .= "Disallow: $path/wp-admin/\n";
$output .= "Allow: $path/wp-admin/admin-ajax.php\n";
}}}
Thank you.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63467>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list