Categories
WordPress
Last updated:
February 21, 2025
Fix broken links in WordPress

Clicking a link only to land on an error page is frustrating. It disrupts the browsing experience, makes a website look unprofessional, and can even hurt search rankings. Yet, broken links often go unnoticed until they start affecting traffic and engagement.

Fixing these issues regularly keeps visitors on your site and prevents search engines from downgrading rankings. Fortunately, the process to repair the dead links on the WordPress site doesn’t have to be tedious. 

The right tools make identifying and repairing broken links in WordPress a quick and hassle-free task.

This guide outlines effective ways to find and fix broken links in WordPress. But first, let’s define a broken link.

A broken link is a hyperlink that no longer leads to its intended destination. Clicking on it results in an error page instead of the expected content.

For example, here’s the URL for the SiteAim homepage:

And here’s the link to the SiteAim blog:

If either of these pages were removed or their URLs changed without a redirect, anyone clicking on the old link would see an error message instead of the content they expected.

Now that we understand what a broken link is, let's look at why it occurs and the problems it can create.

A link can break for many reasons, but the most common is when a page gets deleted or moved without a redirect in place. This triggers a "404 Not Found" error, which disrupts the browsing experience and affects SEO.

What Causes Broken Links

On WordPress sites, broken links often appear after switching to a new domain or removing a post or page without updating internal links. 

Even a small typo in a URL can create a dead link, and these issues can be overlooked for months. 

Simply put, most broken links happen due to:

  • An incorrect or misspelled URL
  • A changed page URL or slug
  • A deleted page or post
  • A linked website changing domains
  • A website being temporarily down

If a linked page is unavailable for a short time, waiting might be the best option. The real problem comes when a page is gone for good. In that case, updating the link to the correct page or replacing it with a relevant source keeps your site running smoothly.

Visitors expect links to work. Clicking on one that leads to an error page is enough to make them leave and look elsewhere. If this keeps happening, engagement drops, and your site starts losing credibility. A website filled with broken links appears neglected, making it seem untrustworthy or outdated.

Search engines don’t penalize sites directly for broken links, but they won’t pass any ranking value to missing pages. If a high-authority website links to a page no longer exists, that’s a missed opportunity. Fixing these issues ensures your site remains relevant and maintains any SEO benefits from external links.

Note: An external link is a hyperlink that directs users from your website to a different domain. These links connect to other websites for additional information, references, or resources.

Long story short, regular maintenance is very important to keep everything running smoothly. Checking for broken links at least once or twice a year (or more often) helps keep content fresh and visitors happy. 

Now, you might be thinking about manually checking for broken links on your WordPress site. But that's not the best approach. Here's why it won't work efficiently.

Manually checking for broken links might seem like a doable solution at first. However, it’s inefficient and unsustainable. Even on a moderately sized website, reviewing every page and verifying each link takes hours (or even more). 

And the real problem is that it’s not a one-time fix. 

New broken links can appear at any time due to deleted pages, changed URLs, or external site issues. Keeping up with this manually means constantly diverting attention from more important tasks.

Automated tools and plugins provide a far more effective approach. They scan your site, flag broken links in minutes, and often offer easy ways to remove or update them. 

Intrigued? Here are five effective methods on how to find broken links on WordPress. Let’s go through them one by one.

Finding Broken Links in WordPress with Broken Link Checker

To check for broken links on WordPress is easier than you might think. The Broken Link Checker plugin by All in One SEO (AIOSEO) helps keep all links on your WordPress site working properly. It automatically scans for dead links, whether internal or external and flags anything that leads to a 404 error. 

Also Read: 14 Best WordPress Maintenance Plugins to Keep Your Site Running in 2025

It runs on an external server, so it won’t slow down your website or get blocked by managed hosting providers like WP Engine.

Here’s how you can get started with this WordPress broken links plugin.

Installing and Setting Up Broken Link Checker

Installing and Setting Up Broken Link Checker

Start by installing and activating the plugin. The Setup Wizard will launch right away to guide you through the process.

Note: The free version scans up to 200 internal links. To check more links (including external links), you will need to upgrade to the Pro version.

Creating an Account

Connect Your Site to a Free Broken Link Checker Account or an Existing Account

The next step is to create a free account or connect an existing plan.

  • Clicking ‘Create a Free Account’ prompts you to enter basic details like name, email, and phone number. A credit card is required if you plan to upgrade after hitting the 200-link limit.
  • If a Pro version is already purchased, select ‘Connect to an Existing Account’, log in, and choose the active plan.

Scanning for Broken Links

Once activated, the plugin works in the background. It starts scanning posts, pages, and custom post types. The ‘Broken’ tab displays a categorized report of dead links, redirects, and dismissed entries.

Scanning for Broken Links

Fixing broken links is straightforward:

  • Edit URL – Update the broken link directly.
  • Unlink – Remove the link from your content.

After making changes, click ‘Update’ to apply them.

Fixing broken links

Clicking the Information () icon provides extra details, including how long the link has been broken, its HTTP status, and response headers.

View status details on broken links

Adjusting Plugin Settings

The Settings tab allows customization of which content types (posts, pages, custom post types) and statuses (published, draft) should be monitored. 

The plugin runs automatic scans every three days to ensure broken links are caught and fixed without constant manual effort.

Semrush is a widely used SEO tool that helps track website health and performance. Its Site Audit feature scans your site for issues, including broken links, and provides a detailed report to help with fixes.

Let’s find out how to check broken links in WordPress using Semrush. 

Set Up a Semrush Account

A Semrush account is required to use the Site Audit tool. While it is a paid service, the free plan allows scanning up to 100 pages on one domain. Paid plans start at 100,000 pages per month.

Access the Site Audit Tool

After logging in, navigate to the Site Audit option in the left-hand menu. Click on it to open the audit dashboard.

Create a New Project

Adding a New Site Audit Project in Semrush

On the Site Audit page, click Create Project at the top. Enter your website’s domain name and confirm by clicking Create Project again.

Type a Domain for Your New Site Audit Project

Configure the Audit Settings

Semrush will prompt you to configure the audit settings. Adjust the number of pages to crawl based on your needs, then start the audit. The process may take a few minutes, depending on the size of your website.

Review the Audit Report

Semrush Report Showing Broken Links

Once the scan is complete, go to the Site Audit section and click on your domain. The report will display various website issues, including broken links. These will be highlighted in blue, allowing for quick identification. Clicking on them provides more details about the affected pages.

Export the Report

To save the findings, click the Export button at the top right. The downloaded report will be useful when fixing broken links on your site.

Ahrefs is a powerful SEO tool that provides in-depth insights into your website’s performance. Businesses, marketers, and SEO professionals use it for keyword research, competition analysis, and monitoring site health. 

The Site Explorer tool helps track backlinks and identify pages that return errors.

Let’s see how you can use it to find broken links. 

Sign Up and Access Site Explorer

Ahrefs is a paid service, so creating an account is necessary before using its tools. After logging in, enter your website’s domain name into the Site Explorer search bar.

Sign Up and Access Site Explorer

Generate a Backlink Report

Once the Site Explorer tool begins crawling your website, it compiles data into reports. Depending on the size of your site, this process may take some time. After completion, the dashboard will display an overview of your website’s backlink profile.

Identify Broken Links

Navigate to Pages » Best by Links» and sort the results by 404 status. This will filter the report to show broken links on your site.

Finding Broken Links Using Ahrefs

Export and Fix Broken Links

Ahrefs allows exporting reports in CSV format, making it easy to review and fix broken links. Once the list is ready, update or redirect broken links to maintain a smooth user experience and strong SEO performance.

Manually hunting down broken links can be time-consuming, especially on a large website. MonsterInsights simplifies this by using Google Analytics to track 404 errors, giving you a clear view of where broken links exist.

Setting Up MonsterInsights for Link Tracking

MonsterInsights connects Google Analytics to WordPress without requiring code edits. The free version covers basic tracking, while the Pro version offers advanced insights like eCommerce tracking and detailed reports.

First, sign up for a Google Analytics account and link it to your WordPress site using MonsterInsights. 

Finding Broken Links in Google Analytics

Once MonsterInsights is active, it starts tracking broken links, though data only appears after around 24 hours. 

Here’s how to access it:

  1. Open Google Analytics and go to the Explore tab.
  2. Select Blank Report to create a new custom report.
Create a Blank Explore Report in Google Analytics
  1. Name it something relevant, such as Broken Links.
Creating a New Explore Report in Google Analytics
  1. Click the ‘+’ next to Dimensions and search for:
    • Page title
    • Page path + query string
  2. Select both and hit Import.
Importing Dimensions to Your Report

Adding Metrics to Your Report

To track how often broken links are triggered:

  1. Click the ‘+’ next to Metrics.
  2. Find Sessions and click Import.
Import the Sessions Metric to Your Report
  1. Drag the Page title and Page path + query string into the Rows section.
  2. Move Sessions to the Values section.
Adding Metrics to Your Report

Filtering for 404 Errors

To isolate broken links from other data:

  1. Scroll to Filters and select Page title.
isolate broken links from other data:
  1. Set Conditions to contains.
  2. Enter the title of your 404 error page (e.g., “Page Not Found”).
Set Conditions to contains
  1. Click Apply.

Tip: Unsure about your 404 page title? Type a random URL on your site (e.g., yoursite.com/random-URL) and check the title in your browser tab.

Downloading and Fixing Broken Links

The report now lists all pages with 404 errors. However, Google Analytics often cuts off long URLs. 

To see the full details:

  1. Click the Download icon at the top-right.
Downloading and Fixing Broken Links
  1. Open the file and find the broken URLs.
    • The broken link appears after ?page=.
    • The page containing the broken link appears after &from=.

Use this data to update or remove broken links. To revisit this report later, check the Explore tab in Google Analytics.

Google Search Console helps website owners monitor their site’s performance in search results. It also flags errors, including broken links that lead to 404 pages. If you’re looking for a free way to track down dead links, this tool is a great starting point. 

Here’s how to get started:

Set Up Google Search Console

Before anything else, your website needs to be connected to Google Search Console. If you haven’t done this yet, follow a setup guide to link your site.

Open the Pages Report

Log in to your Google Search Console account and click on Pages in the left-hand menu.

Google Search Console Pages Report

Filter for Not Indexed Pages

Check the box next to Not Indexed to see a list of pages that Google couldn’t add to its search index.

Google Search Console Pages That Aren't Indexed

Locate 404 Errors

Locate 404 Errors

Scroll down to the Why pages aren’t indexed section. Look for the Not found (404) category and click on it. This will show a list of all broken links that led visitors to missing pages.

Once you’ve found the broken links, the next step is fixing them. Let’s explore how to do that.

You can do it either by updating, redirecting, or removing them to keep your website error-free. The best approach is to redirect users to a relevant page, ensuring they don’t land on an error page.

Redirecting Broken Links to Relevant Pages

A broken link should point to a page that offers similar content. If a post was moved, redirecting it to the new URL maintains continuity. When a page no longer exists, guiding visitors to a related resource prevents them from hitting a dead end.

Setting up 301 redirects is the most effective way to handle this. It tells search engines that the page has permanently moved, preserving SEO value while improving user experience.

Using AIOSEO for Easy Redirection

The simplest way to set up redirects in WordPress is with the AIOSEO plugin. Its built-in redirection manager allows you to track 404 errors and create 301 redirects without any coding.

Note: The redirection feature is available in the AIOSEO Pro version.

Setting Up 301 Redirects in AIOSEO

  1. Install and activate AIOSEO Pro 
  2. Enable the Redirects feature: Navigate to All in One SEO » Redirects, then click Activate Redirects.
Setting Up 301 Redirects in AIOSEO
  1. Turn on 404 error logging: Under the Settings tab in Redirects, find the Logs section and enable 404 logs. Set the logging period to no longer than a month for optimal performance. 
Enable 404 Logs
  1. Click Save Changes to apply the settings.

Fixing Broken Links in AIOSEO

Once 404 logging is active, AIOSEO will display a list of broken links under the 404 Logs tab. This section will show:

  • The broken URL
  • How many visitors landed on it
  • The last time it was accessed

To fix a broken link:

  1. Click Add Redirect next to the broken URL.
404 Logs Under Redirects
  1. Enter the new Target URL where visitors should be redirected.
Redirecting a 404 Error Using AIOSEO
  1. Select 301 Moved Permanently as the redirection type.
  2. Click Add Redirect to save the changes.

Testing the Redirect

Visit the broken link to confirm the redirection is working. Repeat this process for all broken links on your website to maintain a smooth browsing experience and protect your SEO rankings.

Not all web hosts support the Broken Link Checker plugin. Providers like WP Engine and GoDaddy often block it due to high resource consumption. If your site is hosted on one of these platforms, there are still reliable ways to detect and fix broken links in WordPress using third-party tools. 

These tools generally fall into two categories:

1. SEO Audit Software

SEO tools like Screaming Frog offer a comprehensive way to scan your website for broken links. These tools crawl your site just like a search engine, generating detailed reports on broken URLs that need fixing.

2. Web-Based Link Checkers

Online tools such as W3C Link Checker provide a quick and free way to scan for dead links. These require no installation. You simply enter your website URL, and the tool will list any broken links found.

Let's explore how these tools work and how you can use them to find and fix broken links in WordPress.

Using Screaming Frog to Find Broken Links

Screaming Frog is a website crawler that helps analyze on-site SEO, and it also works as a broken link checker. The free version allows scanning up to 500 URLs, making it a useful tool for small to medium-sized websites.

Scanning Your Website for Broken Links

  1. Download and install Screaming Frog.
  2. Enter your website’s URL in the search field.
  3. Configure the settings to crawl All Subdomains and click Start to begin scanning.
The top menu bar in Screaming Frog containing a search field to enter the URL user wants to crawl

Filtering for Broken Links

Once the scan is complete:

  1. Go to the Response Codes tab.
  2. Use the dropdown filter and select Client Error (4xx) to isolate pages with broken internal and external links.
The top menu bar in Screaming Frog containing a search field to enter the URL user wants to crawl

Locating Broken Links

To find where the broken links appear on your site:

  1. Click on any error URL from the list.
  2. Open the Inlinks tab at the bottom to see the exact pages containing the broken link.

This method ensures you can quickly pinpoint and fix broken links, keeping your site’s SEO and user experience intact.

Using W3C Link Checker to Detect Broken Links

W3C Link Checker offers a free and straightforward way to identify broken links on your website. Enter the URL of the page you want to review, click the Check button, and let the tool scan for issues.

Using W3C Link Checker to Detect Broken Links

Detailed Reports for Better Analysis

List of broken links and suggested actions generated by the W3C Link Checker

The tool generates a comprehensive report highlighting broken links along with suggested fixes. This level of detail makes it especially useful when evaluating a website after major updates like a redesign or domain migration.

For first-time audits or routine maintenance, W3C Link Checker provides a reliable way to ensure all links on your site remain functional.

Note to remember: These broken links checker WordPress tools help detect broken links, but removing them from your posts or pages still requires manual effort.

Plugins work well for spotting and fixing broken links, but handling a large number of them manually can be tedious. 

For websites with extensive content or frequent migrations, advanced methods like database edits, bulk replacements, and WP-CLI commands offer a faster way to clean up broken links without relying solely on plugins.

Fixing Broken Links via phpMyAdmin (For Large-Scale Fixes)

Editing database entries directly can save time when many links need updating. phpMyAdmin allows you to replace broken URLs in bulk, but it requires caution to avoid accidental changes.

  1. Access phpMyAdmin from your hosting control panel.
  2. Select your WordPress database and open the wp_posts table. Click on the SQL tab and enter a query to find all instances of a broken link:
  3. SELECT * FROM wp_posts WHERE post_content LIKE '%old-broken-link.com%';  
  4. To replace all occurrences of the broken URL with a new one, run this command:
  5. UPDATE wp_posts SET post_content = REPLACE(post_content, 'old-broken-link.com', 'new-link.com');  
  6. Click Go to apply changes.

This method is useful when updating links after a domain change or migration. Always back up your database before making modifications.

Using Regular Expressions (RegEx) for Bulk URL Replacements

When links follow a specific pattern, RegEx (Regular Expressions) can be used for bulk replacements. WordPress plugins like Better Search Replace or command-line tools like WP-CLI support RegEx-based modifications.

For example, if all broken links contain a common structure, such as:

https://oldsite.com/category/post-name

And need to be updated to:

https://newsite.com/category/post-name

A RegEx pattern can be used to replace them in one step instead of editing each link individually.

  • In Better Search Replace, enter the following pattern:
    • Search: https:\/\/oldsite\.com\/category\/(.*)
    • Replace: https://newsite.com/category/$1
  • Click Run Search/Replace, and the tool will update all matching links.

RegEx helps in cases where URLs have structured patterns, preventing errors that can occur with manual find-and-replace methods.

How to Use WP-CLI to Scan and Fix Broken Links

WP-CLI (WordPress Command Line Interface) provides a faster way to detect and fix broken links, especially on large websites.

  1. Connect to your WordPress site via SSH. Run the following command to scan for broken links inside posts:
  2. wp db query "SELECT ID, post_content FROM wp_posts WHERE post_content LIKE '%old-broken-link.com%';"  
  3. To replace a broken link with a working one, use:
  4. wp db query "UPDATE wp_posts SET post_content = REPLACE(post_content, 'old-broken-link.com', 'new-link.com');"  

WP-CLI is faster than using plugins, making it ideal for developers or website managers handling large databases.

We’ve explored various ways to find and fix broken links in WordPress. Now, let’s talk about how to prevent them from happening in the first place. 

Fixing broken links is one thing, but keeping them from happening in the first place saves time and frustration. A few proactive steps can help keep your website running smoothly without link-related issues.

1. Plan Before Deleting or Moving Pages

Removing a page or changing a URL without considering existing links creates problems. Before making changes, check if other pages link to that URL. If a page must be removed, set up a 301 redirect to guide users to a relevant alternative. 

This way, visitors won’t hit a dead end, and search engines won’t flag missing pages.

Also Read: WordPress Source Code: How to Find & Access It Easily

2. Keep an Eye on External Links

Websites shut down, restructure, or remove content, causing external links to break without warning. Instead of blindly adding links, check if the source is reliable and unlikely to disappear anytime soon. 

Using a link monitoring tool can help catch outdated links before they become a problem.

3. Run Periodic Link Audits

Websites grow over time, and so do the chances of links breaking. Setting a schedule to audit internal and external links every few months helps catch and fix issues before they hurt rankings or user experience.

Small steps like these go a long way in keeping your website error-free. Instead of constantly fixing broken links, a little maintenance ensures visitors always land where they’re supposed to.

MethodToolsDescriptionBest for...
PluginBroken Link Checker by AIOSEOAutomatically scans for broken links and provides easy fixes.Ongoing maintenance, small to medium sites.
SEO AuditSemrush (Site Audit)Comprehensive site audit that includes broken link detection.In-depth analysis, larger sites, SEO professionals.
Backlink AnalysisAhrefs (Site Explorer)Identifies broken backlinks and pages with 404 errors.Backlink tracking, SEO experts.
Analytics TrackingMonsterInsights & Google AnalyticsTracks 404 errors to pinpoint broken links.Data-driven analysis, understanding user behavior.
Search ConsoleGoogle Search ConsoleReports broken links found by Googlebot.A free solution, identifying indexing issues.
Manual RedirectionAIOSEO (Pro)Set up 301 redirects to fix broken links.Efficient redirection, preserving SEO value.
Database EditphpMyAdminBulk replaces broken URLs in the database.Large-scale fixes, technical users.
Bulk ReplaceBetter Search Replace, WP-CLIUse regular expressions to update multiple links at once.Pattern-based fixes, developers.
Command LineWP-CLIScan and fix broken links using a command-line interface.Fast and efficient, developers, large sites.

Wrapping It Up: No More Dead Ends

Broken links are like potholes on a busy road that are frustrating for visitors and bad for traffic flow. You now have the tools, tricks, and advanced methods to fix them, so there’s no excuse for leaving dead links behind. 

But keeping your site error-free isn’t a one-time job; it’s an ongoing process.

That’s where SiteAim comes in. Instead of chasing down broken links and troubleshooting WordPress issues on your own, let our expert team handle it for you. With 24/7 maintenance and support, we ensure your site stays secure, fast, and always up-to-date.

Need a hand? We’re just a click away.

FAQs

1. How do I fix a broken link in WordPress?

    Use a plugin like Broken Link Checker to identify broken links. Then, update or remove each faulty link directly from your WordPress dashboard.

    2. How to fix a broken WordPress site?

      Begin by deactivating all plugins to rule out conflicts. If the issue persists, switch to a default theme like Twenty Twenty-One. Always back up your site before making changes.

      3. How to fix WordPress URLs?

        If your site's URLs are not working correctly, go to your WordPress dashboard, navigate to Settings > Permalinks, and click 'Save Changes' to refresh your URL structure. Ensure your .htaccess file is correctly configured.

        4. What causes broken links?

          Broken links occur when a page is deleted or its URL changes without updating the corresponding links. Typos, changes on external sites, and domain or hosting issues can also render links inaccessible.

          5. Should I remove broken links on my site?

            Yes, removing or fixing broken links is very important. Unresolved broken links can frustrate visitors, harm your website’s reputation, and negatively impact search engine rankings.

            6. Can I replace broken links with new links?

              Absolutely. Replacing dead links with new and working ones ensures visitors are directed to relevant content. This enhances user experience and improves overall  SEO.

              Sunbul is an English Literature graduate with over five years of experience in technical writing. She specializes in creating clear and engaging content for a variety of industries.
              Sunbul Ali
              Sunbul is an English Literature graduate with over five years of experience in technical writing. She specializes in creating clear and engaging content for a variety of industries.
              Related Posts
              wordpress maintenance plugins
              Sunbul Ali
              A study by Google found that 53% of users leave a site if it takes more than three seconds to ...
              February 17, 2025
              web design trends
              Sunbul Ali
              The first impression matters.  The design is often the first thing a visitor notices on your site. It’s what grabs ...
              February 11, 2025
              WordPress Source Code
              shamaim
              Many WordPress users struggle with customization. They want to change designs, fix issues, or improve performance but don’t know how ...
              February 4, 2025
              1 2 3
              Copyright © 2025 SiteAim
              Connect us on
              cross