Disable Shortlink Header Without Plugin to remove unnecessary short URLs from your WordPress header. Here’s how to do it with a simple tweak.
Step 1: Add the Shortlink Header Disable Code
Add this to your child theme’s functions.php:
// Remove shortlink from head
remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10, 0);
remove_action(‘template_redirect’, ‘wp_shortlink_header’, 11, 0);
How It Works
These actions remove the default WordPress shortlink meta tag from your <head> and the shortlink HTTP header.
Why Disable Shortlink Header Without Plugin?
Most sites don’t use WordPress shortlinks. Removing them cleans up your site header and prevents duplicate URL signals that can confuse search engines.
Common Mistake
If you rely on shortlinks for social sharing or API calls, don’t disable this. Otherwise, it’s safe to remove.
Pro Tip
Add this tweak to your child theme’s functions.php so it stays active after theme updates.
Related Snippet
If you liked this, check out my guide on disabling self pingbacks without a plugin in WordPress.