Support » Plugins » Hacks » Remove pingback link from header?

  • Resolved Ate Up With Motor


    I don’t need or want either remote publishing or pingbacks — I’m concerned about spam — so I’ve removed the xmlrpc.php file. However, the pingback links still appears in the site header and I want to remove it.

    I tried inserting this code into my child theme’s functions.php file:

    function remove_x_pingback($headers) {
        return $headers;
    add_filter('wp_headers', 'remove_x_pingback');

    …but that didn’t do it.

    How can I get rid of the header link without hacking up the theme’s header.php file to delete it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p


    Go to Admin – Settings – Discussion

    Uncheck this: Allow link notifications from other blogs (pingbacks and trackbacks.)

    That was the first thing I did, but the link is still in the header. It’s being called by the parent theme’s header.php file.

    Moderator t-p


    What theme are you using?

    A child theme based on Frontier.

    Moderator bcworkz


    You could filter ‘bloginfo’ and change any ‘pingback_url’ values to a 403 page or something, but the meta link will still be there. The only way to get rid of that is copy headers.php to your child theme and actually remove the meta link from the template.

    Moderator t-p


    A child theme based on Frontier

    Do you have header.php in your child theme? yes? Try removing the link in there.

    I talked to the theme developer, who offered this:

    function remove_pingback_url( $output, $show ) {
        if ( $show == 'pingback_url' ) $output = '';
        return $output;
    add_filter( 'bloginfo_url', 'remove_pingback_url', 10, 2 );

    This doesn’t remove the link, but clears the URL from the href, so it appears as

    <link rel="pingpack" href="">

    That’s probably close enough.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove pingback link from header?’ is closed to new replies.