'remove_shortlink',
'title' => 'Remove shortlink tag',
'desc' => 'Remove rel=shortlink from the page head and HTTP headers',
'icon' => 'code',
'risk' => 'safe',
'level' => 'beginner',
'audience' => 'everyone',
'priority' => 3,
'benefit' => 'Visitors and search engines rarely use the shortlink. Removing it tidies the page head; shortlink URLs keep working.',
'help' => 'WordPress adds a shortlink such as ?p=123 to posts and pages, as a tag and a Link: HTTP header. This removes both. Visiting ?p=123 still takes people to the post.',
'before' => '',
'after' => 'Removed.',
'detect' => function () {
return array(
'detected' => true,
'message' => 'Present in page source',
'safe' => true,
'savings' => 'Cleaner HTML',
);
},
'callback' => function () {
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
remove_action( 'template_redirect', 'wp_shortlink_header', 11 );},
);