{"id":1824,"date":"2024-12-17T10:47:10","date_gmt":"2024-12-17T09:47:10","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/desactiver-la-balise-wordpress-shortlink-link\/"},"modified":"2025-01-02T17:05:25","modified_gmt":"2025-01-02T16:05:25","slug":"desactiver-la-balise-wordpress-shortlink-link","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/disable-wordpress-shortlink-link-tag\/","title":{"rendered":"Disable the WordPress shortlink  tag"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Optimize Your Site's HTML Code with WPMasterToolKit's \"Disable WordPress Shortlink Tag\" Module<\/h1>\n\n\n\n<p>By default, WordPress inserts a <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> for shortlinks in the <code data-no-auto-translation=\"\">&lt;head&gt;<\/code> and adds a corresponding HTTP header. These shortlinks, although sometimes useful, are rarely used by visitors or administrators in modern scenarios. With the <strong>Disable WordPress Shortlink Tag<\/strong> from WPMasterToolKit, you can easily remove this unnecessary tag and header, optimizing your site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why disable shortlinks?<\/h2>\n\n\n\n<p>WordPress shortlinks were designed to provide a short version of your URLs, particularly useful for sharing links. However:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Limited use :<\/strong> In many cases, shortlinks are unused and their removal does not affect your site's core functionality.<\/li>\n\n\n\n<li><strong>Performance:<\/strong> Reducing unnecessary tags and headers lightens HTML code and slightly improves performance.<\/li>\n\n\n\n<li><strong>Simplicity:<\/strong> Cleaner, minimal HTML code is always preferable for maintenance and SEO purposes.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Main features of the Disable WordPress Shortlink Tag module<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Delete tag <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> shortlink :<\/strong> Automatically deletes the shortlink tag added in the <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>.<\/li>\n\n\n\n<li><strong>Deleting the HTTP shortlink header :<\/strong> Also disables HTTP header <code data-no-auto-translation=\"\">X-WP-Shortlink<\/code> sent with the answers.<\/li>\n\n\n\n<li><strong>Automation :<\/strong> Once activated, the module works without any additional configuration.<\/li>\n\n\n\n<li><strong>Clean HTML code :<\/strong> Guarantees cleaner code and a better user experience.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">How does the module work?<\/h2>\n\n\n\n<p>WordPress uses two main actions to generate shortlinks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action <code data-no-auto-translation=\"\">wp_shortlink_wp_head<\/code> :<\/strong> Adds the <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> shortlink in the <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>.<\/li>\n\n\n\n<li><strong>Action <code data-no-auto-translation=\"\">wp_shortlink_header<\/code> :<\/strong> Adds HTTP header <code data-no-auto-translation=\"\">X-WP-Shortlink<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>The module <strong>Disable WordPress Shortlink Tag<\/strong> disables these two actions using the following hooks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code data-no-auto-translation=\"\">remove_action( 'wp_head', 'wp_shortlink_wp_head' );<\/code><\/strong> : Deletes the <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> from <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>.<\/li>\n\n\n\n<li><strong><code data-no-auto-translation=\"\">remove_action( 'template_redirect', 'wp_shortlink_header', 100, 0 );<\/code><\/strong> Disables HTTP header.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How do I use the Disable WordPress Shortlink Tag module?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Activate the :<\/strong> Go to the WPMasterToolKit dashboard and activate the module <strong>Disable WordPress Shortlink Tag<\/strong>.<\/li>\n\n\n\n<li><strong>Automation :<\/strong> The module automatically removes the shortlink tag and header from your site.<\/li>\n\n\n\n<li><strong>Check the results:<\/strong> Inspect your site's source code for the absence of the <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> and header <code data-no-auto-translation=\"\">X-WP-Shortlink<\/code>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Use cases<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Modern sites :<\/strong> Most sites don't use WordPress' built-in shortlinks, preferring tools like Bitly or TinyURL to create short links.<\/li>\n\n\n\n<li><strong>SEO and optimization :<\/strong> Cleaner HTML code can help search engines better understand your site.<\/li>\n\n\n\n<li><strong>Performance:<\/strong> Removing unnecessary content from the DOM and HTTP headers slightly reduces response size and improves loading times.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Technical documentation: the hooks used<\/h2>\n\n\n\n<p>The module uses two main hooks to disable shortlinks:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code data-no-auto-translation=\"\">remove_action( 'wp_head', 'wp_shortlink_wp_head' );<\/code><\/strong><br>Deletes the <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> automatically generated by WordPress for shortlinks.<br>Example: <code data-no-auto-translation=\"\">remove_action( 'wp_head', 'wp_shortlink_wp_head' );<\/code><\/li>\n\n\n\n<li><strong><code data-no-auto-translation=\"\">remove_action( 'template_redirect', 'wp_shortlink_header', 100, 0 );<\/code><\/strong><br>Disable HTTP header <code data-no-auto-translation=\"\">X-WP-Shortlink<\/code> sent by WordPress.<br>Example: <code data-no-auto-translation=\"\">remove_action( 'template_redirect', 'wp_shortlink_header', 100, 0 );<\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Our technical choices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Universal compatibility :<\/strong> This module is compatible with all modern versions of WordPress where shortlink actions are used.<\/li>\n\n\n\n<li><strong>Easy to use :<\/strong> Once activated, the module operates automatically without manual configuration.<\/li>\n\n\n\n<li><strong>Target impact :<\/strong> By deleting only unnecessary elements, the module doesn't affect any other site functionality.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The module <strong>Disable WordPress Shortlink Tag<\/strong> from WPMasterToolKit is ideal for administrators who want to optimize their WordPress site by removing unnecessary tags and headers. If you don't use WordPress's built-in shortlinks, this module is a simple and effective solution to lighten your HTML code and slightly improve performance.<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Remove unnecessary tags and headers with WPMasterToolKit's Disable WordPress Shortlink Tag module. This module automatically disables the addition of the <link> and X-WP-Shortlink header associated with WordPress shortlinks, cleaning up your code and optimizing your site. Simple, effective and quick to use!<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_robots_primary_cat":"","_seopress_titles_title":"Optimisez votre site avec WPMasterToolKit","_seopress_titles_desc":"Am\u00e9liorez la performance de votre site en supprimant les balises shortlink inutiles avec le module Disable WordPress Shortlink Tag. Optez pour un code HTML \u00e9pur\u00e9 !","_seopress_robots_index":"","_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1824","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}