A discussion of why you may choose to use relative or absolute internal links in your WordPress blog website.
Pros for Using Absolute Links for Internal Links in your WordPress blog
Yoast SEO Internal Link Counter Woes
If you’re using Yoast SEO, the internal link checking only works on absolute links (2023). So, if you’d like to use this helpful too, then you’re forced to use absolute links.
Cons for Using Absolute Links for Internal Links in your WordPress blog
Comments show every pingback for your internal links, but that’s fixable
If you have pingbacks/trackbacks turned on, then by default, your blog will make absolute links of your own internal links a trackback that you must manually accept/delete/ignore. You have options if you use absolute internal links and want trackbacks turned on.
First, of course, there are plugins. You can install a plugin such as No Self Pings or add a snippet of PHP to your functions.php. I use the plugin Snippets to manage my functions.php snippets. I explain how to use the Snippets plugin on your WordPress site in this post.
This code snippet stops WordPress’s comments from tracking internal pings or trackbacks.
WordPress PHP Snippet for Removing Self Ping Backs
function no_self_ping( &$links ) {
$home = get_option( 'home' );
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, $home ) )
unset($links[$l]);
}
add_action( 'pre_ping', 'no_self_ping' );