Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [rel-canonical]

The link element rel=canonical in the head of a page with a certain URL points search engines to the original URL of that page.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

Change Paginated Blog Canonicals

I have a Wordpress website, with Elementor and Yoast. For my blog, I use an Elementor widget to display my posts on a custom template, the ‘Maple Grid’ widget. However, I have a canonical problem on ...
AFM's user avatar
  • 1
1 vote
1 answer
67 views

How can I do automatic redirects to canonical URLs as defined by Yoast SEO?

This client is using Yoast SEO (the free version) to specify primary categories for posts, a feature not available in the WordPress core. They discovered recently, via an SEO report, that the same ...
William Beaumont's user avatar
0 votes
1 answer
129 views

Yoast SEO canonical URL gets pointed to the homepage

I noticed in Google Search Console that pages are increasingly getting removed from the index due to their canonical. For some reason — it points to the home page for some articles. After some digging,...
dodov's user avatar
  • 197
0 votes
0 answers
155 views

Canonical Tag Issue with Dual Product URLs in WooCommerce & Yoast SEO

I recently noticed an issue with the URL structure of my products on my WooCommerce site. Specifically, each product has two versions of URLs, illustrated as follows: https://www.example.com/main-...
Mighty's user avatar
  • 1
0 votes
1 answer
786 views

wp_get_canonical_url showing first url of the post for custom page

I have created a tag.php page in the theme. It's working perfectly. I am getting the tags post on the page. Now I have added the below link to the header.php page. <link rel="alternate" ...
user9437856's user avatar
1 vote
1 answer
3k views

How to use the Yoast SEO wpseo_canonical filter to set a canonical URL for /, /au/ & /uk/ sites in a MU environment

Our company has markets in USA, UK & Australia. We've just started using WP MU on our development server where the USA/global version is @ www.example.com, and then there are www.example.com/uk/ &...
Steve's user avatar
  • 1,727
1 vote
0 answers
285 views

How to fix Ahref error showing wordpress admin pages as "Duplicate pages without canonical"?

I am using Ahref tool for performing a site audit on a WordPress based site. The site audit shows an error "Duplicate pages without canonicals" with a page count of 110. When I check the ...
Syed's user avatar
  • 11
0 votes
1 answer
719 views

Change cannonical URL after changing url with add_rewrite_rule()

So, I'm making a plugin for some niche application for my customer which involves a table with data, and I created a page within the plugin to show more in-depth information about the table row. This ...
Miguel Vieira's user avatar
0 votes
1 answer
1k views

Blog home page has canonical link that is incorrect. Do not see where to change this

As part of our website we have a wordpress blog in a subdirectory. I scanned our main site for broken links. The scan included the wordpress blog in the subdirectory. Some "broken links" ...
Jeffrey Simon's user avatar
1 vote
2 answers
3k views

Wrong Canonical url link

I have a weird problem. I have a page that changed URL (because it's parent changed name). Example Link https:www.mysite.com/my-services/service-1 is now: https:www.mysite.com/services/service-1 ...
thegirlinthecafe's user avatar
0 votes
0 answers
814 views

Remove WP Core canonical for category pagination

It seems that WP is adding a canonical to the root of my pagination, and no indexing all other pages on Category pages. For example, /locations/residential/?_page=2 is no-index, and gives /locations/...
Obsidian's user avatar
1 vote
0 answers
83 views

How to use relative urls without canonical and prev-next?

I want to use relative urls instead of absolute urls but not all types. Here's just a few examples. Exclude: canonical urls, prev and next post like this: <link rel="canonical" href="https://www....
Aslan's user avatar
  • 13
0 votes
1 answer
39 views

Wordpress replaces "https://" with "//" for Site & Wordpress-URL

When I save "https://example.com" in General Settings as my Site & Wordpress URL, it gets replaced by "//example.com". To analyze the problem, I checked the Wordpress database, but 'WP_HOME' and ...
rob_87's user avatar
  • 3
1 vote
1 answer
394 views

?cat=-1 Indexed Versions Of Homepage

I'm finding some strange query strings on my homepage are indexed in Google and causing duplicate content. A couple of examples: https://sciencetrends.com/page/103/?cat=-1 https://sciencetrends.com/?...
Tnace's user avatar
  • 17
0 votes
0 answers
313 views

adding wordpress yoast SEO canonical url from "transition_post_status" hook

I am using transition_post_status hook to add get some data at the time of post is publish but i can access any variables but when i am trying to set canonical url from add_filter it is return 500 ...
Gaurav Aggarwal's user avatar
1 vote
1 answer
2k views

Setting custom canonical urls

I have a page that requests and displays information from a database. All is fine but I'm having some trouble setting custom canonical URLs for this single page only and its URLs (with parameters ...
H.California's user avatar
0 votes
0 answers
103 views

tried putting this <link rel="canonical" href="https://www.example.com<?php echo $_SERVER['REQUEST_URI'];?>"> as canonical tag

This message pop up at dashboard "Your website URL has recently been changed. Automatic payments and customer emails have been disabled to prevent live transactions originating from development or ...
Aditya Kumar's user avatar
3 votes
3 answers
944 views

What's the purpose of admin canonical tag?

I have searched through Google and WordPress developer resources, but nothing came up. I understand the purpose of rel="canonical" tag in a website's frontend (it's part of the website SEO), but I ...
Binar Web's user avatar
0 votes
2 answers
4k views

Customize rel=canonical tag for single blog post

I wrote a guest blog post for another website. I'd like to publish this same blog post on my website but include a canonical URL that points to the original publisher. This allows me to post the ...
David Gaskin's user avatar
0 votes
1 answer
2k views

Why are <link rel> tags from the header showing up on my Wordpress site? [closed]

I am testing my new WP site. I wanted to see how it worked using a text-only browser, so I fired up "links" from my shell to visit the site. At the top of the page before my navigation menu, the ...
Francis Barton's user avatar
1 vote
0 answers
254 views

After changing siteurl ,home url form database it shows 3/4 errors called

Notice: Undefined index: host in /home/bhavani/public_html/wp-includes/canonical.php on line 444
aswin moorthi's user avatar
1 vote
2 answers
629 views

WP didn't redirect to canonical category URL

I have a problem with canonical redirect. mydomain.com/mycat is the correct category URL but the following URL works too: - mydomain.com/asdfa/mycat - mydomain.com/1234/mycat - mydomain.com/...
Tekhouse's user avatar
1 vote
1 answer
5k views

Pagination url canonical problem

I have pagination link look like http://example.com/page/2 . The rel="canonical" is displayed like http://example.com/2. How this can be fixed
Anton Balyan's user avatar
1 vote
1 answer
538 views

add the post as canonical for attachment page wordpress

the attachment page should have canonical added to the main post on attachment page (image.php) I currently have (automatically added by All in One Seo Pack): <link rel="canonical" href="https://...
vyperlook's user avatar
  • 177
5 votes
1 answer
8k views

stop redirection on /wp-admin call to /wp-login

I am building a website, with wordpress+buddypress (latest version). In this website, I have my own custom login|signup|resetpass forms, and i do not want to link them to back-end wp-forms. And I ...
Poofy's user avatar
  • 69
7 votes
3 answers
16k views

Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445

After changing siteurl ,home url form database it shows 3/4 errors called Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445 Notice: Undefined index: scheme ...
Mehedi_Sharif's user avatar
0 votes
0 answers
727 views

Google Indexed sub pages in wordpress pagination in post

I'm using WordPress Pagination in Post. So that users can view the same post in different parts. Issue - Google is indexing all the subpages. How to resolve it? :/ http://example.com/post/ (...
Akshay Makadiya's user avatar
4 votes
2 answers
4k views

Wrong canonical link on wp-admin pages

I have a subdomain: https://blog.example.com/ I forcibly redirects to directory: https://www.example.com/blog By changing site URL and some RewriteRule on .htaccess. My .htaccess: <...
Muhammad Riyaz's user avatar
2 votes
3 answers
4k views

remove rel=next on home page but not others

There is a major problem with most new templates for WordPress that want you to set your homepage to Your Latest Posts. This is to enable many of the great theme features to work. The problem with ...
MitchellK's user avatar
  • 131
2 votes
1 answer
3k views

How to bulk edit canonical url's in SQL?

I've been assigned to edit the canonical URL's (rel="canonical" found in the head)of about 600 posts on a client's site. Not all of the posts will use the same canonical url. Nor are these 301's or ...
jtorres's user avatar
  • 23
1 vote
0 answers
335 views

Wordpress within a subdirectory of another Wordpress environment doesn't work

Here's a summary of my scenario: I'm running Wordpress on a linux environment The root directory contains and index.php file that references the subdirectory where my main site's files are (codex ...
Orun's user avatar
  • 390
1 vote
1 answer
556 views

Wordpress Redirecting Non Category Pages /page/nnn to their Canonical URLs

I seemingly to have a strange issue I have found in almost every other Wordpress site. Suppose, you have set your Blog home to a static WP page /myhome. And you have a separate page for blog /blog. ...
shamittomar's user avatar
0 votes
1 answer
455 views

Two urls for one website

I have a customer that started his small business using an url called "firstname-lastname.ch". Since he was lucky enough to grow and now wants a proper URL, he would like to have another URL for his ...
wxT3APyGfkYJVK's user avatar
0 votes
0 answers
173 views

Changing permalinks and canonical [duplicate]

I have a domain with permalinks set to /%postname%/ but now I would like to change to /%category%/%postname%/ I thought who ever now come from a book mark to http://domain.com/my-first-post ...
JDesigns's user avatar
  • 131
0 votes
2 answers
67 views

Configuring Home Page Address

I though this was a simple issue. When i type in the browser: www.example.com it changes to: www.example.com/home/ This delivers the proper contents from the Home page, but i wish to stay showing ...
Brethlosze's user avatar
2 votes
2 answers
569 views

Why isn't the canonical link element used for all pages?

The canonical link element isn't set for all pages. For example, if I look at the source code for a post, I can see the following in the <head>: <link rel='canonical' href='http://example....
henrywright's user avatar
  • 3,077
23 votes
3 answers
59k views

How to prevent automatic redirection of 404 errors and "incorrect" URLs?

Wordpress has a feature whereby it will automatically redirect your URLs if it percieves them to be written wrongly. Here is an example: I have a page called my-page If I go to: www.mysite.com/...
Mazatec's user avatar
  • 1,026