Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- By default Wordpress will ping itself with each internal link.
- This is annoying and a tad inefficient. To disable:
- 1. Open your Wordpress theme's functions.php file located in /wp-content/themes/[YOUR THEME]/
- 2. Paste the code snippet below into your functions.php
- 3. Save to have the changes take effect.
- */
- function disable_self_pings( &$links ) {
- foreach ( $links as $i => $link )
- if ( 0 === strpos( $link, get_option( 'home' ) ) )
- unset($links[$i]);
- }
- add_action( 'pre_ping', 'disable_self_pings' );
Add Comment
Please, Sign In to add comment