• Resolved scrhorton

    (@scrhorton)


    My site runs without SSL, so all pages are http.

    However, it seems that on a random selection of pages/post, Yoast SEO is setting the canonical link to a https version of the http page.

    This causes problems as Google then indexes the https page, which doesn’t exist and throws an error if a user clicks on this page in Google search results.

    The pages affected seem to be random. Maybe 10% of all pages on the site at any one time.

    If I make an edit and ‘update’ an affected page, the canonical link is thereafter corrected to use http.

    Here is an example of an affected page (may not persist for long though):

    https://www.bradleystokejournal.co.uk/directory/

    If you view the page source for the above page, you see:

    <link rel=”canonical” href=”https://www.bradleystokejournal.co.uk/directory/” class=”yoast-seo-meta-tag” />

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi @scrhorton

    Thanks for reaching out. I’m sorry about your wrong canonical URLs. Did you recently switch your website from HTTPS to HTTP?

    Next, try the following steps:

    1. Install & activate the Yoast Test Helper plugin
    2. Go to Tools > Yoast Test
    3. Locate the Yoast SEO section and click on the ‘Reset indexables tables & migrations‘, ‘Reset Prominent words calculation‘, and ‘Reset Internal link counter‘ buttons. After each click, the page will reload to confirm that the specific reset was successful.
    4. Go to SEO > Tools, and under SEO data, click the “Start SEO data optimization” button to allow Yoast to rescan your content.

    Do let me know how it goes.

    Thread Starter scrhorton

    (@scrhorton)

    Hi @rohans123,

    Thanks for your reply.

    To answer your question, no – the website has always been http. I have never attempted to move to https.

    Somehow it seems that Yoast SEO intermittently thinks (incorrectly) that the website has moved to https. Any idea why that could be?

    Hi @scrhorton,

    We are not sure about the cause of the issue. Probably the database contains HTTPS entries.

    Can you please try the steps mentioned in my previous reply and let us know whether that resolves the issue?

    Looking forward to your reply.

    Thread Starter scrhorton

    (@scrhorton)

    Hi?@rohans123,

    I will try your suggestion, but I do wonder how https entries might have got into the Yoast SEO database in the first place if the website has NEVER used https.

    The concern is that if we don’t determine the true cause and address it in some way, the issue may reoccur after the database has been cleared.

    Hi @scrhorton,

    The setting for whether a site uses HTTP or HTTPS is controlled in WordPress by the WordPress Address (URL) and Site Address (URL) values, which are located in?Settings?>?General.

    You would need to make sure that both of these are set to use your preferred version (http/https and www/non-www).

    You can also do a complete scan of your database to see if there are any HTTPS entries.

    Thread Starter scrhorton

    (@scrhorton)

    Hi?@rohans123,

    I have used the Yoast Test Helper plugin as you suggested. It will, however, take some time to determine if it has resolved the issue.

    FYI The WordPress Address (URL) and Site Address (URL) values are both set to http and have been since the site was started 15 years ago.

    Given the above, I am curious to understand what might cause Yoast SEO to incorrectly use a https address in the canonical link for a post/page that has a http address.

    Thread Starter scrhorton

    (@scrhorton)

    Hi?@rohans123,

    Sadly your suggested actions have not solved the issue.

    ?Yoast SEO is still incorrectly setting the canonical link in the header of random posts/pages to a https version of the http page.

    I remain curious to understand what might cause Yoast SEO to incorrectly use a https address in the canonical link for a post/page that has a http address.

    I have a number of other websites that are set up in the same way and none of these exhibit this issue.

    Plugin Support Maybellyne

    (@maybellyne)

    Please update from Yoast SEO 21.5 to 21.8. The canonical URL of A-Z Business Directory shows the correct URL without HTTPS. See screenshot. Can you share some other URLs where you noticed the problem exists?

    Thread Starter scrhorton

    (@scrhorton)

    Hi @maybellyne,

    As I mentioned previously, there is a randomness about which pages are affected. As far as I can determine, about 7% of pages on the site are currently affected by this issue at any given time.

    At the time of writing, this is one of the affected pages:

    https://www.bradleystokejournal.co.uk/2015/10/16/local-community-shows-support-syrian-refugees/

    and here is the screenshot showing the https canonical:

    https://pasteboard.co/DR4gwlhqYLJk.jpg

    Note: By the time you read this it may have changed!

    This Google query shows how many https pages Google is picking up due to the canonical being wrong:

    site:bradleystokejournal.co.uk inurl:https

    However if you check many of those entries, the canonical has since reverted to http. So it seems this is a random/intermittent problem.

    Thread Starter scrhorton

    (@scrhorton)

    @maybellyne @rohans123

    Still struggling to understand why Yoast is inserting a https URL as the canonical link for a http page.

    If I deactivate Yoast, core WordPress inserts the correct http canonical link.

    If someone could explain the algorithm that Yoast uses to determine the value it uses for the canonical link, I might be able to deduce the root cause of this issue.

    Anyone, please?

    Plugin Support Maybellyne

    (@maybellyne)

    I am sorry that the issue continues as it does on that URL you shared, @scrhorton. You can learn about how the Yoast SEO implements the canonical URL here.

    You mentioned that resetting the indexables with the Yoast Test Helper plugin didn’t make a difference while the issue is resolved when you deactivate Yoast SEO.

    Can you please perfrm a proper conflict check? The fastest way to rule out any conflict is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Twenty-Two.

    Please test this on your development or staging site if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin has a troubleshooting mode, which does not affect normal visitors to your site.

    If you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process: How to check for plugin conflicts

    If you feel uncomfortable doing this yourself or if this does not solve your issue, our Yoast SEO Premium plugin comes with one year of (technical) support.

    Thread Starter scrhorton

    (@scrhorton)

    @maybellyne,

    Thanks for your reply.

    Before I investigate possible plugin conflicts, I would like to progress my original question…

    The developer document that you reference, in relation to construction of the ({{URL}} component of the canonical tag, states:

    “If the application is aware of the website’s preferred protocol (e.g., a developer or user has defined an option for the site’s address which includes?http?or?https), then the protocol value should be retrieved, and a?:?character should be appended to the variable (to produce, e.g.,?https:).”

    I am interested to know how Yoast becomes “aware of the website’s preferred protocol”. What data is it looking at to determine this?

    Plugin Support Maybellyne

    (@maybellyne)

    The Yoast SEO plugin determines the protocol based on the?home_URL?or?site address?defined in WordPress > Settings > General or in the?wp-config?file to fetch URLs.

    Thread Starter scrhorton

    (@scrhorton)

    @maybellyne,

    I can confirm that WordPress Address (URL) and Site Address (URL) on the Settings | General page are both set to https://www.bradleystokejournal.co.uk

    The wp-config.php file does not contain any ‘DEFINE’ entries for WP_HOME or WP_SITEURL.

    Is there anything else that Yoast might be using to determine the protocol?

    Plugin Support Maybellyne

    (@maybellyne)

    No, that’s the only way it determines the protocol

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Canonical URL incorrectly uses https instead of http’ is closed to new replies.