Wrong Canonical URL From Yoast Plugin

wrong canonical url from yoast plugin on wordpress
Home » Blog » Wrong Canonical URL From Yoast Plugin
Free Web Marketing Consultations

Helping B2B Technology Companies Increase Their Lead Volume.
Serving: IT, MSP, Cybersecurity, Software Dev, SaaS, ISV, VARs & More.

Table of Contents
    Add a header to begin generating the table of contents

    The other day I was reviewing some indexed pages in Google Search console trying to understand why I was having a drop in rankings and noticed that I had both canoncial URLs and Open Graph tags indexed in Google that were pointing to my local development machines URL. WTF? I knew that the Yoast Plugin was responsible for outputting this information dynamically so I started to do some digging in how this was happening and why there was the wrong canonical URL from Yoast.

    After much back and forth with my hosting provider and multiple publishes of my website with the issue resurfacing I was able to pinpoint the cause of the issue relating to the recent release of their “indexables” feature in 14.0.

    Yoast Indexables

    For those who don’t know the indexables feature means that now much of the SEO meta data for a given page is stored in a table in the database, the YOURWPPREFIX_yoast_indexable table. This is meant to speed up the process of retrieving SEO meta data and prevent dynamic pulls in PHP from slowing down page load speeds.

    Unfortunately this table is not registered on the $wpdb object. Many hosting providers, including the one leveraged by Tortoise and Hare Software will use a wp search-replace CLI command internally when pushing sites from one environment to another, e.g. staging to production, to update the sites URL from the current domain to the destination domain.

    If you look at the wp search-replace command documentation you’ll see that the base command will only run on tables included in the $wpdb object which does not include the yoast_indexable table! This command would have to be run with an –all-tables flag to include the yoast indexables tables and that may not be feasible for all hosting providers as this can update more than one instance of WordPress if there are multiple instances stored on the same server.

    I’m not sure if this was an oversight or not on the part of the yoast team or if that was intentional. Either way, the problem will likely persist on hosting providers for the time being and in the meantime more than a few sites are likely publishing out bad canonicals and other references to 404’d or private domains.

    Wrong Canonical URL From Yoast Plugin Workaround

    The best and least invasive workaround at this time is for you to reset the yoast indexables from your production environment. This option is much safer than running a search replace command on production.

    Reset Yoast Indexables

    This is the option I recommend for fixing the issue of wrong canonical URLs from yoast. It’s the safest option and works great.

    1. First off install the Yoast Test Helper Plugin
    2. From WP Admin go to tools > Yoast Test
    3. Click on the reset indexables tables & migrations button
    4. Go to the yoast plugin tools by clicking SEO > tools
    5. Click the “start processsing and speed up your site now button”
      increase site speed button yoast indexables

    That’s it your done. Yoast will regenerate the database tables and your canonicals and open graph tags should be working again with the correct domain name in your URL. Please note that you will have to go through this exercise every time you push from a lower environment to production.

    I’m sure the Yoast team is going to be flooded with support requests about this issue and hopefully they will roll out a fix in the coming months that allows the plugin to play nicer with hosting providers. Until then you can use this workaround for the wrong canonical URL from Yoast to repair your SEO on WordPress.

    Update:

    As of Yoast 15.2, this issue still persists.

    Questions, thoughts? Drop a comment below and get the discussion started.

    Share This Article
    Posted in: ,
    Tagged: , ,

    Hunter Nelson

    Hunter is the founder and president of Tortoise and Hare Software, a digital marketing agency for the technology sector and other lead generation oriented businesses. Hunter has more than 10 years’ experience building web applications and crafting digital strategies for companies ranging from scrappy startups to Fortune 50 household names. When not on the clock, you'll find him spending time with his family and pups, relaxing on the beach, or playing competitive online video games. See for more.

    18 responses to “Wrong Canonical URL From Yoast Plugin”

    1. Rick Avatar
      Rick

      Thanks Hunter, worked like a charm. Saved me a lot of time on this!

      1. Hunter Nelson Avatar
        Hunter Nelson

        You’re welcome!

    2. Jake Avatar
      Jake

      Glad this post popped up. Was seeing the same problem after using search-replace and then of course when I used wp to search for the old dev link in the dB it did not pick it up either. Have used all-tables and reactivated toast plugin

      1. Hunter Nelson Avatar
        Hunter Nelson

        Yep, it’s a sneaky issue. I just checked it recently and it still persists in certain cases as of 01/21. I suspect it will be an ongoing battle without a change in direction on Yoast’s end. I saw they recently tried to disable re-indexing on non production environments but that’s not a sufficient fix :-/

    3. Andy Ingham Avatar
      Andy Ingham

      We encountered this issue as well. Thanks for the helpful post.

      1. Hunter Nelson Avatar
        Hunter Nelson

        You’re welcome, glad we could help

    4. Elijah Avatar
      Elijah

      We’ve also had this issue, but unfortunately our production site has login disabled as a security measure and I can’t login to regenerate the URLs.
      Hopefully this is being addressed/fixed.

      1. Hunter Nelson Avatar
        Hunter Nelson

        Sorry to hear that. That’s a tricky situation, but I certainly understand the need to restrict access.

    5. Mudassir Avatar

      Hello Nelson, I stumbled upon this post as I encountered the wrong canonical URLs on my blog’s posts with Yoast plugin. I understand that you recommend to use “Yoast test helper”, but I wanted to give a try to “Rank math”, so I installed it and now the issue is resolved.

      I appreciate you put this information on the Internet, otherwise people like us might get panic. Thanks and have a good day.

      1. Hunter Nelson Avatar
        Hunter Nelson

        Glad to hear you found an alternative solution that works for you. Switching plugins is a task that might create other problems such as written meta descriptions from Yoast not carrying over to RankMath or lost functionality when moving from Yoast to RankMath. If you are running them both at the same time, some people may also not want to install both of them at the same time for performance reasons, cyber security risks, or maintainability concerns as well. I know the original purpose of the indexable update for Yoast was for performance reasons. RankMath is most likely using dynamic canonicals instead of loading them from an indexed DB table. That may solve the immediate problem, but miss out on the whole reason for Yoast implementing the indexable feature in the first place. I approved your comment here but just want other people to be aware that this may not be the best fix for them and there’s more to it than just “install RankMath problem solved”.

    6. Maulik Dave Avatar

      I have one Issue coming on my site. I have already changed my website name but showing the old website name on google. and many times check not clearly showing sitemap in google and others search engine portal. Please help me how to fix this issuee.

      1. Hunter Nelson Avatar
        Hunter Nelson

        It takes a few days after making a change for Google to detect changes to your site. You can speed the process up by requesting a manual re-indexing for each page you’re concerned about at the following link: Manual Index. I’m not sure what you mean about the sitemaps.

    7. Carl France Avatar

      Hunter, I found your article as I encountered the wrong canonical URLs within the portfolio on one of our clients’ websites.

      It worked a treat and resolved the issue for me so thank you so much for taking the time to put it together and sharing it with us all.

      1. Hunter Nelson Avatar
        Hunter Nelson

        Hey Carl, you’re welcome. Glad I could help.

    8. Barny Avatar

      Hi all. I was use non www then I changed my website to www. I did reset the migrations. When can it apply for this my website? Thanks for your help.

    9. Absa Avatar
      Absa

      I reset the tables with Yoast Helper but my issue is still not solved. Still getting “Document does not have a valid rel=canonicalPoints to the domain’s root URL (the homepage), instead of an equivalent page of content” from Pagespeed.
      Installing Rankmath solved the issue but I really want to solve it with Yoast but no luck since.

    10. Ven Avatar
      Ven

      Thanks. Lost ranking due to this. Cant beleive the issue persists still.,

      1. Hunter Nelson Avatar
        Hunter Nelson

        You’re welcome

    Leave a Comment





    Recent Blog Posts

    Aesopians E8 – How SaaS Companies Are Maintaining Brand Integrity and Operationalizing Growth with HubSpot Ft. Mohamed Hamad Of Third Wunder Agency

    SaaS companies move fast—but if your branding and systems can’t keep up, growth can actually become a liability. In this episode of the Aesopians Podcast, host Hunter Nelson is joined…

    The Ultimate Guide To ChatGPT SEO

    Most SEO professionals are racing to understand how AI tools are reshaping visibility. But the biggest shift isn’t coming from Google—it’s coming from ChatGPT. As organic search volumes and conversions…

    MSP Google Ads Costs and Pricing

    You’ve heard Google Ads can generate leads quickly, but you’re not sure how much to budget, what kind of results to expect, or whether it’s really worth the spend. Many…

    Aesopians E7 – Joining The Feel Good MSP Sales Training Program Ft. Brian Gillette

    In this episode of the Aesopians Podcast, we sit down with Brian Gillette, founder of Feel-Good MSP and creator of the “Feel-Good Close.” If you’re an MSP leader who’s tired…

    MSP Advertising Strategy: 3 Fundamental Approaches to Drive Real Growth

    Is your MSP making effective use of your advertising budget, or are you weighed down too much by bottom of funnel advertising tactics that leave you in a perpetual cycle…

    How We Save Thousands With Negative Keywords For MSP Google Ad Campaigns

    Google Ads is one of the most powerful inbound lead generation channels available to managed service providers. There are few better moments to introduce your brand than when someone is…

    Aesopians E5: From Tech To Rep: Year 1 In MSP Sales Ft. Ashton Fortuna

    Most MSPs hesitate to move technicians into sales—worried they’ll lack the polish, confidence, or killer instinct to close deals. Sales is a different game. Techs solve problems with systems; sales…

    SEO Not Working: Here’s Why

    Lately I’ve been getting on more and more calls lately with people saying something along the lines of “we’ve been doing SEO or inbound for 6 months, 12 months, or…

    Why SEO Investments Help Your MSP Weather a Recession and Keep the Door Open for New Opportunities

    What happens to your pipeline when the phones go quiet, inboxes stay cold, and paid ads stop converting? That’s not a hypothetical. It’s what happens in a recession. Budgets freeze.…

    MSP Marketing – How to Build a Strategy That Works

    Let’s be honest—most MSP marketing doesn’t work.Not because the tactics are bad, but because they’re unaligned. What looks like a marketing problem is often a strategy problem in disguise. Most…

    The 10 Best MSP SEO Agencies To Help You Grow Organic Traffic

    If you’re searching for SEO agencies for MSPs, the list of generalists can feel endless—and underwhelming. Most SEO providers don’t understand the managed services space, much less the buyer behavior,…

    Why Your MSP’s Online Marketing Efforts Are Failing

    If you’re leading an MSP and investing in online marketing, you’re probably feeling a growing sense of frustration. You’ve put money into websites, content, ads—even hired an agency or two…

    What Makes a Great MSP Website? 5 Examples You Should Follow

    Your MSP website is more than just an online brochure—it’s a powerful tool for attracting and converting potential clients. But what makes a website truly effective in the competitive managed…

    Case Study: Cold Start To 2-5 Leads Per Month Via Local SEO For MSP In Canada

    Client Background A Managed IT Services Provider (MSP) in British Columbia, Canada engaged us to establish a professional online presence and generate a steady flow of inbound leads. Before working…

    Aesopians Episode 4: Leading with Cybersecurity To Spark MSP Sales Conversations – Featuring Michael Bakaic Of Iceberg Cyber

    In this episode of the Aesopians Podcast, Hunter Nelson sits down with Michael Bakaic from Iceberg Cyber to discuss how MSPs can use cybersecurity as a conversation starter to attract…

    WordPress Out OF Memory Exceptions

    Recently I’ve been dabbling in programmatic SEO. I got an idea of rolling out a landing page to attract search engine traffic from every major city in the United States…

    Aesopians Episode 3 – Cold Email Marketing For MSPs Featuring Jeffrey Newton Of Cyft.AI

    In this episode of The Aesopians Podcast, Hunter Nelson sits down with Jeffrey Newton, Co-founder of Cyft and former MSP sales and marketing leader, to discuss the realities of running…

    Case Study: Sourcing 30+ Email Opt-Ins Per Month For Cybersecurity SaaS Startup Via Google Ads

    In this case study we’ll share how we helped a Cybersecurity SaaS startup source roughly 30 email opt-ins per month via Google Ads to help fuel their email marketing efforts…

    Aesopian’s Episode 2 – Streamlining SEO Content Production Featuring Raj Khera Of Make Media

    In this episode of the “Aesopians” podcast, we’re joined by Raj Khera, a serial entrepreneur and the founder of Make Media, to discuss how small businesses can transform their approach…

    Aesopians Episode 1 – Azure Cloud For MSPs

    In the debut episode of Aesopian’s Podcast, host Hunter Nelson sits down with Matt Hache, an infrastructure consultant at PAX8 and founder of Neon Cobra, to explore how Managed Service…

    Related Blog Posts

    Aesopians E8 – How SaaS Companies Are Maintaining Brand Integrity and Operationalizing Growth with HubSpot Ft. Mohamed Hamad Of Third Wunder Agency

    SaaS companies move fast—but if your branding and systems can’t keep up, growth can actually become a liability. In this episode of the Aesopians Podcast, host Hunter Nelson is joined…

    The Ultimate Guide To ChatGPT SEO

    Most SEO professionals are racing to understand how AI tools are reshaping visibility. But the biggest shift isn’t coming from Google—it’s coming from ChatGPT. As organic search volumes and conversions…

    MSP Google Ads Costs and Pricing

    You’ve heard Google Ads can generate leads quickly, but you’re not sure how much to budget, what kind of results to expect, or whether it’s really worth the spend. Many…

    Aesopians E7 – Joining The Feel Good MSP Sales Training Program Ft. Brian Gillette

    In this episode of the Aesopians Podcast, we sit down with Brian Gillette, founder of Feel-Good MSP and creator of the “Feel-Good Close.” If you’re an MSP leader who’s tired…

    MSP Advertising Strategy: 3 Fundamental Approaches to Drive Real Growth

    Is your MSP making effective use of your advertising budget, or are you weighed down too much by bottom of funnel advertising tactics that leave you in a perpetual cycle…

    SEO Not Working: Here’s Why

    Lately I’ve been getting on more and more calls lately with people saying something along the lines of “we’ve been doing SEO or inbound for 6 months, 12 months, or…

    Why SEO Investments Help Your MSP Weather a Recession and Keep the Door Open for New Opportunities

    What happens to your pipeline when the phones go quiet, inboxes stay cold, and paid ads stop converting? That’s not a hypothetical. It’s what happens in a recession. Budgets freeze.…

    MSP Marketing – How to Build a Strategy That Works

    Let’s be honest—most MSP marketing doesn’t work.Not because the tactics are bad, but because they’re unaligned. What looks like a marketing problem is often a strategy problem in disguise. Most…

    Why Your MSP’s Online Marketing Efforts Are Failing

    If you’re leading an MSP and investing in online marketing, you’re probably feeling a growing sense of frustration. You’ve put money into websites, content, ads—even hired an agency or two…

    Case Study: Cold Start To 2-5 Leads Per Month Via Local SEO For MSP In Canada

    Client Background A Managed IT Services Provider (MSP) in British Columbia, Canada engaged us to establish a professional online presence and generate a steady flow of inbound leads. Before working…

    Case Study: Sourcing 30+ Email Opt-Ins Per Month For Cybersecurity SaaS Startup Via Google Ads

    In this case study we’ll share how we helped a Cybersecurity SaaS startup source roughly 30 email opt-ins per month via Google Ads to help fuel their email marketing efforts…

    9 Ways To Leverage AI To Deliver Better ROI On Your Marketing Spend

    At Tortoise and Hare, we understand the challenges mid-market technology businesses face when it comes to generating leads and maximizing marketing budgets. That’s why we’ve embraced cutting-edge AI tools to…

    Case Study: TNHS Generates 30 Leads In 6 Months For DC Metro MSP

    In July of 2024 a Washington D.C. metro based MSP reached out to Tortoise and Hare Software for help with some of their advertising campaigns. This MSP was working with…

    Microsoft Loop Presents Marketing Opportunity For MSPs

    Introduction Microsoft Loop, a recent addition to the Microsoft 365 suite, is already creating buzz in the tech community, and for a good reason. With its native integration into widely…

    Granting Access To Google Search Console

    In this post we’ll show a brief overview of how to grant access to Google Search Console to a 3rd party marketing provider. What Is Google Search Console? Google Search…

    Granting Access To Google Tag Manager

    In this post we provide you with a brief overview of Google Tag Manager and show you how to grant us access to the platform as a 3rd party marketing…

    Granting Access To GA4

    In this post we will provide a brief overview of Google Analytics 4 (GA4) and show you how to grant access to a 3rd party marketing partner. What Is Google…

    5 SEO Strategies for MSPs to Turbocharge Revenue Growth

    Search engine optimization (SEO) is one of the most powerful tools in your marketing arsenal. For managed service providers (MSPs), developing a strong SEO strategy can mean the difference between…

    Top MSP White Label Content Providers

    Are you struggling to keep your content pipeline filled with high-quality material that truly resonates with your target audience? You’re not alone. Managed IT service providers (MSPs) often face the…

    The Ultimate Guide To MSP Website Optimization

    A well-optimized website is essential for Managed Service Providers (MSPs) looking to scale their business, attract more leads, and achieve a lucrative exit. A lot of MSPs check a few…

    Top Blog Content

    The Ultimate Guide to Hiring an MSP Marketing Agency

    Are you one of the many MSPs struggling to attract new clients consistently? According to research conducted by MSP Dojo, a leading MSP sales consulting firm, approximately 85% of MSPs…

    The Ultimate Guide To MSP Website Optimization

    A well-optimized website is essential for Managed Service Providers (MSPs) looking to scale their business, attract more leads, and achieve a lucrative exit. A lot of MSPs check a few…

    The Ultimate Guide To Paid Search On Google Ads For Managed Service Providers

    Generating leads for your MSP can be a challenge. You spend so much time managing employees, making sure customer support tickets are answered, procuring hardware, and defending against cyber threats,…

    The Ultimate Guide To MSP SEO

    Search Engine Optimization (SEO) is one of the most important ways to attract new business for mid-market managed service providers (MSP). If you look at MSPs that have achieved any…

    The Ultimate Guide To Setting A Marketing Budget For IT Companies

    Many IT companies get their start as a one-man operation and rely almost exclusively on word of mouth, referrals, and other organic offline means to get past their initial growth…

    Featured Review of Tortoise and Hare

    ryan drake president nettech consultants
    R.D.
    President Florida Based MSP

    Tortoise and Hare has been a key partner in our MSP's growth. Over the year's we've worked together they've helped our MSP dramatically increase our website traffic, and build a steady stream of leads sourced from our website and advertising efforts. Over that time, we've been able to raise our base customer size, build economies of scale to more efficiently service customers, and expand into new markets.