Support » Themes and Templates » Frontier » Removing pingback URL

  • Resolved Ate Up With Motor

    (@ate-up-with-motor)


    Hi,

    Is there a way to remove the pingback link from the header without adding a duplicate header.php file in the child theme? I don’t use pingbacks and have actually deleted xmlrpc.php (I’m having suspicious users trying to hit it directly, and I know in the past people have figured out ways to exploit it), so the link isn’t actually pointing to anything anyway.

    I tried adding this code to functions.php:

    function remove_x_pingback($headers) {
        unset($headers['X-Pingback']);
        return $headers;
    }
    add_filter('wp_headers', 'remove_x_pingback');

    …but the link is still there, so that wasn’t it. Any suggestions?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author ronangelo

    (@ronangelo)


    Is there a way to remove the pingback link from the header without adding a duplicate header.php file in the child theme?

    There’s a setting for disabling pingbacks on Dashboard -> Settings -> Discussion. Doesn’t that work for you?

    so the link isn’t actually pointing to anything anyway.

    If it’s not pointing to any file, how is it affecting your site?

    Anyway, this should remove the pingback url on the head.

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

    Okay, that took the URL out (the link is still there, but that filter leaves the href empty).

    It wasn’t affecting the site directly, since I removed the xmlrpc file, but I didn’t want to have a link in the header pointing to a nonexistent file.

    Thanks again! I really appreciate your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing pingback URL’ is closed to new replies.