{"id":142540,"date":"2015-07-11T11:00:42","date_gmt":"2015-07-11T15:00:42","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=142540"},"modified":"2015-07-04T06:49:31","modified_gmt":"2015-07-04T10:49:31","slug":"fix-broken-links","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/fix-broken-links\/","title":{"rendered":"How to Fix (Or Remove) Broken Links on Your WordPress Website"},"content":{"rendered":"<p>Have you found a link (or more) on your WordPress website that leads to\u00a0the infamous\u00a0<a href=\"https:\/\/wpmudev.com\/blog\/guide-404-pages\/\" target=\"_blank\">&#8220;404&#8221; error<\/a>? Try not to panic. This is actually very common \u2013 you&#8217;ve simply discovered a link that isn&#8217;t going where it&#8217;s supposed to.<\/p>\n<p>Broken links \u2013 otherwise known as &#8220;dead&#8221; links \u2013 are as common as dandelions\u00a0and can occur twice as frequently. The 404 error is your browser&#8217;s way of saying &#8220;Hey, this link is trying to take us somewhere&#8230; But there&#8217;s nothing <em>here<\/em>.&#8221;<\/p>\n<p>Considering that the usability of your links is a large factor in your site&#8217;s credibility, keeping them valid\u00a0is critical. You&#8217;ll also be happy to\u00a0know that\u00a0broken\u00a0links are incredibly easy to\u00a0fix. In fact, after reading this article, you&#8217;ll know what a broken link is, be familiar with some of the best\u00a0link-checking tools out there, and know how to quickly fix or delete broken links with the <a href=\"https:\/\/wordpress.org\/plugins\/broken-link-checker\/\" target=\"_blank\">Broken Link Checker<\/a> plugin.<\/p>\n<h2>What Are Broken Links?<\/h2>\n<p>Unlike working links, <em>broken<\/em> links result in a 404 error when clicked. This is usually because they&#8217;re attempting to redirect visitors to a missing page or a non-existent\u00a0resource.<\/p>\n<p>They occur for quite a few\u00a0reasons, but mostly when the link&#8217;s URL points to a domain that no longer exists, has unusual firewall settings, has been hacked or has failed to maintain proper hosting.<\/p>\n<p>Alternatively,\u00a0broken links sometimes occur when redirecting URLs are written incorrectly. A good example is a link with &#8220;google.com&#8221; as its URL:<\/p>\n<div  class=\"wpdui-pic-regular  \"> <img loading=\"lazy\" decoding=\"async\" class=\"attachment-735x735\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/06\/link-to-google-com.png\" alt=\"Link to google.com\" width=\"735\" height=\"301\" \/> <\/div>\n<p>What&#8217;s wrong with this? Actually, a lot.<\/p>\n<p>You see,\u00a0when the Google URL is typed this way, the browser is actually prompted to look for google.com on your site (something like <em>https:\/\/www.yoursite.com\/google.com<\/em>). Whether you&#8217;re\u00a0creating\u00a0or fixing links, always remember to reference the full URL. You can do this by including &#8220;<em>https:\/\/www<\/em>&#8221; as well as\u00a0the specific page you&#8217;re redirecting to (<em><a href=\"http:\/\/www.google.com\/maps\" target=\"_blank\">https:\/\/www.google.com\/maps\/<\/a><\/em>\u00a0is a good example).<\/p>\n<div>\n<h2>WordPress\u00a0Link-Checking Solutions<\/h2>\n<p>Now that you can recognize broken links, you&#8217;ll want to identify and then either modify or delete them.<\/p>\n<p>That may sound\u00a0easy, but locating broken links\u00a0is the most difficult part of the process. Your method for finding broken links will depend on the frequency of your posts and the density of your online content. If you have a smaller site, with only a handful of links, you can perhaps get by with manually\u00a0testing them once a month and fixing them if\u00a0they break.<\/p>\n<p>Can you imagine digging in and searching through a gigantic site manually? For the sake of your own sanity, don&#8217;t. While painfully testing each and every link on a large site surely builds character, using a helpful link checking tool will allow you to plough through hours (or even days) of work in mere seconds. Not only will the right program save you time, there are a great number of WordPress link-checking options, and most of them are free.<\/p>\n<p>Of course, you&#8217;ll need to weigh the benefits and pitfalls of the specific tools you&#8217;re considering before choosing. If you already have access to Google&#8217;s <a href=\"https:\/\/search.google.com\/search-console\/about\" target=\"_blank\">Search Console<\/a>, you&#8217;re set up for crawlers to scan your site. If you prefer to initiate your own search, there are websites like\u00a0<a href=\"https:\/\/ahrefs.com\/broken-link-checker\" target=\"_blank\">ahrefs broken link checker<\/a> or <a href=\"http:\/\/www.brokenlinkcheck.com\/\" target=\"_blank\">Online Broken Link Checker<\/a> that you can use to quickly scan your site.<\/p>\n<h3>Broken Link Checker<\/h3>\n<p>While certainly not the only option, <a href=\"https:\/\/wordpress.org\/plugins\/broken-link-checker\/\" target=\"_blank\">Broken Link Checker<\/a>\u00a0is a well-regarded link checking plugin for WordPress.<\/p>\n<figure id=\"attachment_217759\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-217759 size-ratio-full\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2019\/06\/blc-wporg-1050x474.png\" alt=\"Broken Link Checker - WordPress Link Checking Plugin\" width=\"1050\" height=\"474\" \/><figcaption class=\"wp-caption-text\">Broken Link Checker can be downloaded for free from WordPress.org<\/figcaption><\/figure>\n<p>Many appreciate the plugin&#8217;s routine scans, as well as how it organizes broken links into a user-friendly table, detects missing images, and flags missing YouTube videos. This tool has been installed on 700,000+ sites and counting.<\/p>\n<p>It should be noted that the goal of this article isn&#8217;t to promote one plugin over another. To date, a variety of link-checking plugins can be found\u00a0in the official <a href=\"https:\/\/wordpress.org\/plugins\/search\/broken+link\/\" target=\"_blank\">WordPress directory<\/a>. After reading this article,\u00a0you may very well decide that another plugin is a better solution to your needs. But since\u00a0the following link checking instructions can only demonstrate\u00a0one plugin, the Broken Link Checker will serve as our example.\u00a0Besides, it&#8217;s my favorite ;-)<\/p>\n<a class=\"general_big_button\" href=\"https:\/\/wpmudev.com\/blog\/cloud-broken-link-checker\/\"><span class=\"text\">Broken Link Checker can now also run as a cloud-based service and it&#8217;s 20x faster!<\/span><span class=\"button-a-b\">Learn more about Cloud BLC<\/span><\/a>\n<\/div>\n<div>\n<h3>How to\u00a0Fix or Remove Broken Links with Broken Link Checker<\/h3>\n<p>Once you have installed and activated Broken Link Checker, it will busy itself with scanning your site. You can check the scan&#8217;s progress by navigating to\u00a0<strong>Settings &gt; Link Checker<\/strong><em>\u00a0<\/em>from the WordPress dashboard:<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\">\n<figure id=\"attachment_197990\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-197990 size-full\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/07\/blc-settings.png\" alt=\"Broken Link Checker\" width=\"600\" height=\"181\" \/><figcaption class=\"wp-caption-text\">BLC will automatically scan your site and check for broken links.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<p>You can change a number of settings\u00a0from this same page, including the following:<\/p>\n<ol>\n<li>Change the frequency at which existing links are checked (new links are checked immediately).<\/li>\n<li>Set email notifications for broken links.<\/li>\n<li>Apply custom formatting to broken and\/or removed links.<\/li>\n<li>Stop search engines from following broken links.<\/li>\n<\/ol>\n<p>You can manage advanced settings like timeouts, execution times, server load limits, show dashboard widget and link actions, select monitor options, and even do a forced recheck from the <strong>Advanced<\/strong> tab.<\/p>\n<p>When you&#8217;re ready to fix some links, click the link at the top of the plugin window that says <strong>Found (x) broken links<\/strong>. The actual number will determine how many broken links you currently have.<\/p>\n<p>You&#8217;ll be presented with a list of links, like this:<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\">\n<figure id=\"attachment_197992\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-197992 size-full\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/07\/blc-broken-links.png\" alt=\"Broken Link Checker - Broken Links\" width=\"600\" height=\"372\" \/><figcaption class=\"wp-caption-text\">As you can see from the number of broken links, I was in dire need of using this plugin!<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<p>There&#8217;s a lot of information to take in here, but the interface is pretty intuitive. From left to right you have the URL of the broken link, the status of the broken link, the anchor text of the broken link, and the source (i.e. the page, post or comment on which the broken link exists).<\/p>\n<p>Dealing with broken links is a piece of cake. Simply hover over a URL and your options will\u00a0appear:<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\">\n<figure id=\"attachment_197993\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-197993 size-full\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/07\/blc-inlinemenu.png\" alt=\"Broken Link Checker - Inline Menu\" width=\"610\" height=\"90\" \/><figcaption class=\"wp-caption-text\">Broken Link Checker menu options.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<p>The options on here are pretty self-explanatory:<\/p>\n<ul>\n<li><strong>Edit URL:<\/strong> Edit (i.e. correct) the URL.<\/li>\n<li><strong>Unlink:<\/strong> Delete the link (but retain the anchor text).<\/li>\n<li><strong>Not broken:<\/strong> Mark the link as not broken (it will disappear).<\/li>\n<li><strong>Dismiss:<\/strong> Hide the link (it will\u00a0be relegated to the\u00a0<em>Dismissed<\/em> category).<\/li>\n<li><strong>Recheck:<\/strong> Recheck the URL if you believe it will now be fixed.<\/li>\n<\/ul>\n<p>That&#8217;s all there is to it! Cycle through the links, taking the appropriate action as you see fit.<\/p>\n<p>There&#8217;s plenty more this plugin can do, but in the spirit of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Pareto_principle\" target=\"_blank\">Pareto Principle<\/a>, I want to share one particularly useful tip with you.<\/p>\n<p>In my experience, the majority of broken links come from the comments section \u2013 typically\u00a0in the form of broken links to commenters&#8217; sites that were entered incorrectly, or simply no longer exist. And while you&#8217;ll want to be more discriminate in unlinking, fixing or removing links within posts and pages, you may not feel the need to navigate through tens (or hundreds) of broken links within comments.<\/p>\n<p>So, rather than wasting your time going through each individually, you can use Broken Link Checker&#8217;s filtering feature to <strong>Unlink<\/strong> them all in one fell swoop.<\/p>\n<p>Start by navigating to\u00a0<strong>Tools &gt; Broken Links<\/strong><em>\u00a0<\/em>from the WordPress dashboard, then click on the\u00a0<strong>Search\u00a0\u00bb<\/strong>\u00a0button:<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\">\n<figure id=\"attachment_197994\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-197994 size-full\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/07\/blc-search.png\" alt=\"Broken Link Checker - Search\" width=\"600\" height=\"436\" \/><figcaption class=\"wp-caption-text\">Click on the Search button.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<p>Select\u00a0<strong>Broken<\/strong><em>\u00a0<\/em>from the\u00a0<strong>Link status<\/strong><em>\u00a0<\/em>drop down box, and\u00a0<strong>Links used in Comments<\/strong><em>\u00a0<\/em>from the\u00a0<strong>Link type<\/strong> drop down box. Then click the\u00a0<strong>Search Links<\/strong><em>\u00a0<\/em>button, and hey presto! You&#8217;ll have a list of broken links\u00a0contained within comments only.<\/p>\n<p>If you&#8217;re anything like me, you will have a\u00a0<em>lot<\/em> of these.\u00a0That being the case, before you bulk delete the\u00a0broken links, click on the <strong>Screen Options<\/strong><i>\u00a0<\/i>tab and increase the\u00a0<strong>Show on screen<\/strong><em>\u00a0<\/em>number to match or exceed the number of broken links:<\/p>\n<div  class=\"wpdui-pic-large   \" > <img loading=\"lazy\" decoding=\"async\" class=\"attachment-1364x1364\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/06\/broken-links-show-on-screen.png\" alt=\"Show more broken links on screen\" width=\"1364\" height=\"399\" \/> <\/div>\n<p>Click <strong>Apply<\/strong><em>\u00a0<\/em>when you&#8217;re ready.\u00a0This may take a moment or two if you choose\u00a0a high number (my 260 took a couple of seconds).<\/p>\n<p>All that&#8217;s left to do now is zap those broken links! Just select all posts by clicking the &#8216;master&#8217; checkbox at the top of the list&#8230;<\/p>\n<div  class=\"wpdui-pic-large   \" > <img loading=\"lazy\" decoding=\"async\" class=\"attachment-1364x1364\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/06\/select-all-broken-links-2.png\" alt=\"Select all broken links\" width=\"1364\" height=\"300\" \/> <\/div>\n<p>&#8230;Then select\u00a0<strong>Unlink<\/strong> from the\u00a0<strong>Bulk Actions<\/strong><em>\u00a0<\/em>drop down box and hit the\u00a0<strong>Apply<\/strong> button. You&#8217;ll be presented with a confirmation box that you&#8217;ll need to agree to.<\/p>\n<p>Then wait. This may take a few moments \u2013 the plugin&#8217;s got some work to do. But once it&#8217;s finished, you&#8217;ll be presented with a simple confirmation screen:<\/p>\n<div  class=\"wpdui-pic-large   \" > <img loading=\"lazy\" decoding=\"async\" class=\"attachment-1364x1364\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/06\/broken-links-removed.png\" alt=\"Broken links removed confirmation\" width=\"1364\" height=\"199\" \/> <\/div>\n<p>Hey presto! Bulk removal FTW.<\/p>\n<h3>Wrapping Up<\/h3>\n<p>If you&#8217;ve followed along to this point, you now know how to locate, recommission or altogether scrap broken links.<\/p>\n<p>While there are many\u00a0options for finding broken links, plugins that enable\u00a0you to schedule scans are probably preferable to link checking sites where you&#8217;ll need to initiate the process. Automatic and scheduled checks are vital because links can and probably <em>will<\/em> die when you&#8217;re not expecting them to. What&#8217;s more, after investing just a little of your time to set up an automated plugin, you won&#8217;t have to even think about your links until you receive an e-mail notification that\u00a0they aren&#8217;t working.<\/p>\n<p>While keeping your links functioning probably won&#8217;t get you oodles of praise, we&#8217;ve all been on sites where links to vital information can&#8217;t be accessed. Strive to be better than that. And remember, the time and attention you put into maintaining\u00a0your links isn&#8217;t just improving your site. It&#8217;s\u00a0laying the groundwork for a valuable\u00a0visitor experience.<\/p>\n<p><strong>How do you track and remove your broken links? Do you have any questions? Fire away in the comments below.<\/strong><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Broken links can drag down the credibility of your site, especially when you have too many. Fortunately, there are lots of incredibly easy fixes, and in today&#8217;s Weekend WordPress Project we recommend our favorite.<\/p>\n","protected":false},"author":37930,"featured_media":198008,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263,11260],"tags":[10181,9798],"tutorials_categories":[],"class_list":["post-142540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-wpmu-dev-products","tag-broken-links","tag-weekend-wordpress-projects"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/142540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/37930"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=142540"}],"version-history":[{"count":24,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/142540\/revisions"}],"predecessor-version":[{"id":197974,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/142540\/revisions\/197974"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/198008"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=142540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=142540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=142540"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=142540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}