Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
1 answer
53 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/ &...
user avatar
  • 1,672
0 votes
0 answers
26 views

How to change custom paginated URLs using PHP code

See our website has pagination URls like below https://www.xxxxxxxx.com/xxxxxxxx/yyyy/zzz/?xx_xxx_page=2 https://www.xxxxxxxx.com/xxxxxxxx/yyyy/zzz/?xx_xxx_page=3 https://www.xxxxxxxx.com/xxxxxxxx/...
user avatar
1 vote
0 answers
230 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 ...
user avatar
  • 11
0 votes
1 answer
434 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 ...
user avatar
0 votes
1 answer
668 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" ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
0 votes
0 answers
406 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/...
user avatar
1 vote
0 answers
51 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....
user avatar
  • 11
0 votes
1 answer
33 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 ...
user avatar
  • 3
1 vote
1 answer
183 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/?...
user avatar
  • 17
0 votes
0 answers
224 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 ...
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 ...
user avatar
0 votes
0 answers
77 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 ...
user avatar
3 votes
3 answers
839 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 ...
user avatar
0 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
1 vote
0 answers
212 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
user avatar
1 vote
2 answers
587 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/...
user avatar
1 vote
1 answer
4k 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
user avatar
1 vote
1 answer
445 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://...
user avatar
  • 165
5 votes
1 answer
7k 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 ...
user avatar
  • 69
6 votes
3 answers
13k 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 ...
user avatar
0 votes
0 answers
609 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/ (...
user avatar
4 votes
2 answers
3k 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: <...
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 ...
user avatar
  • 131
2 votes
1 answer
2k 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 ...
user avatar
  • 23
1 vote
0 answers
202 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 ...
user avatar
  • 360
1 vote
1 answer
484 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. ...
user avatar
0 votes
1 answer
362 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 ...
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 ...
user avatar
  • 131
0 votes
2 answers
63 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 ...
user avatar
2 votes
2 answers
438 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....
user avatar
  • 2,987
20 votes
3 answers
56k 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/...
user avatar
  • 956