Title: Canonical URL incorrectly uses https instead of http
Last modified: January 1, 2024

---

# Canonical URL incorrectly uses https instead of http

 *  Resolved [scrhorton](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/)
 * 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):
 * [http://www.bradleystokejournal.co.uk/directory/](http://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/](https://www.bradleystokejournal.co.uk/directory/)”
   class=”yoast-seo-meta-tag” />
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcanonical-url-incorrectly-uses-https-instead-of-http%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/page/2/?output_format=md)

 *  [Rohan Sadanandan](https://wordpress.org/support/users/rohans123/)
 * (@rohans123)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17311807)
 * Hi [@scrhorton](https://wordpress.org/support/users/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](https://wordpress.org/plugins/yoast-test-helper/)
    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](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17311982)
 * Hi [@rohans123](https://wordpress.org/support/users/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?
 *  [Rohan Sadanandan](https://wordpress.org/support/users/rohans123/)
 * (@rohans123)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17312134)
 * Hi [@scrhorton](https://wordpress.org/support/users/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](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17312281)
 * Hi [@rohans123](https://wordpress.org/support/users/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.
 *  [Rohan Sadanandan](https://wordpress.org/support/users/rohans123/)
 * (@rohans123)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17314894)
 * Hi [@scrhorton](https://wordpress.org/support/users/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](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17316492)
 * Hi [@rohans123](https://wordpress.org/support/users/rohans123/),
 * I have used the [Yoast Test Helper plugin](https://wordpress.org/plugins/yoast-test-helper/)
   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](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17324120)
 * Hi [@rohans123](https://wordpress.org/support/users/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](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17336496)
 * Please update from Yoast SEO 21.5 to 21.8. The canonical URL of [A-Z Business Directory](http://www.bradleystokejournal.co.uk/directory/)
   shows the correct URL without HTTPS. [See screenshot](https://pasteboard.co/dfc5s7OcVy0o.png).
   Can you share some other URLs where you noticed the problem exists?
 *  Thread Starter [scrhorton](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17341002)
 * Hi [@maybellyne](https://wordpress.org/support/users/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:
 * [http://www.bradleystokejournal.co.uk/2015/10/16/local-community-shows-support-syrian-refugees/](http://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](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](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17344524)
 * [@maybellyne](https://wordpress.org/support/users/maybellyne/) [@rohans123](https://wordpress.org/support/users/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](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17344969)
 * I am sorry that the issue continues as it does on that URL you shared, [@scrhorton](https://wordpress.org/support/users/scrhorton/).
   You can learn about how the Yoast SEO implements the canonical URL [here](https://developer.yoast.com/features/seo-tags/canonical-urls/functional-specification/).
 * 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](https://wordpress.org/themes/twentytwentytwo/).
 * Please test this on your development or staging site if you have one. If not,
   we recommend using the [Health Check & Troubleshooting](https://wordpress.org/plugins/health-check/)
   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](https://yoast.com/help/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](https://yoast.com/wordpress/plugins/seo/)
   comes with one year of (technical) support.
 *  Thread Starter [scrhorton](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17345101)
 * [@maybellyne](https://wordpress.org/support/users/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](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17345153)
 * 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](https://wordpress.org/support/users/scrhorton/)
 * (@scrhorton)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17345233)
 * [@maybellyne](https://wordpress.org/support/users/maybellyne/),
 * I can confirm that WordPress Address (URL) and Site Address (URL) on the Settings
   | General page are both set to [http://www.bradleystokejournal.co.uk](http://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](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/#post-17345300)
 * No, that’s the only way it determines the protocol

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/page/2/?output_format=md)

The topic ‘Canonical URL incorrectly uses https instead of http’ is closed to new
replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)

 * 16 replies
 * 3 participants
 * Last reply from: [scrhorton](https://wordpress.org/support/users/scrhorton/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/canonical-url-incorrectly-uses-https-instead-of-http/page/2/#post-17347846)
 * Status: resolved