Canonical URLs all show trailing slash on main site pages - using Yoast SEO for Wordpress - how to correct
-
We are using Yoast for a number of our sites. We use naked domain as the canonical. I have noticed in the header tags that all our sites show the canonical URLs as having a trailing slash:
Example: http;//foxspizzajc.com, when I look at the source code, it shows the canonical as http;//foxspizzajc.com/
Of course, it is much more likely that all sites that link to us will not use the trailing slash - so preferably we do not want that to be the canonical - among other reasons.
Does this need to be fixed so the trailing slash is removed? I cannot see how to do this in Yoast SEO or in Permalinks structure for Wordpress.
Sorry for my ignorance.
Thanks for any help.
-
As far as I understand this, to your browser and to Google, they're the same page (this really seems to only apply to the homepage, other pages "/" really matters a lot).
I would not worry about changing the canonical, in fact it's technically the 'right" location of the page. When it comes to the HTTP docs, a request to the root needs "/". All modern web browsers add it back in for you even if it's not there. This is I believe why the canonical is set as it is there in yoast.
I covered this in a blog as someone asked this at Pubcon this year in a keynote.
http://www.winstondigitalmarketing.com/yoast-homepage-canonical-correct-include-trailing-slash/
-
I searched high and low for how to pull this off for the Yoast plugin specifically for my homepage. And wa-la, here was the answer in the community forum. Thanks guys! The advanced area in the yoast plugin for the homepage did the track. Just the homepage is set now to mywebsite.com instead of mewebsite.com/ Too me this is cleaner for SEO and local search SEO since all citations and inbound links are pointing to mywebsite.com NOT mywebsite.com/ Maybe Google will shine a bit more SERP love on me. We shall see - better make an annotation not in Google analytics so I can reference if positive impact occurred.
-
I wrote to Yoast about this issue but they wouldn't respond because I am using the free plugin. I may respond and let them know about this discussion. Seems like a valid legitimate question, no? I would love an official response...
-
Hi Gianluca,
He was talking about a WordPress website which, by default, already has a 301 redirect in place on the homepage URL with the slash to the URL without the slash.
What's strange is that the Yoast SEO plugin points the homepage canonical tag to the URL with the slash - which is 301 redirected to the URL without!
I know search engines handle this very well and probably just ignore the canonical tag, but if you want it to be 100% correct (and why wouldn't you?) adding a the canonical tag in the Advanced tab is a very easy fix.
-
Gianluca - so you believe their is no reason to actually go in and fix this?
-
Hey Dave - great suggestion. I did that and it worked.
Doesn't it seem strange to you that Yoast, the master of SEO - automatically does this?
Kind of makes me think that Google doesn't see the trailing slash as a different URL for the homepage. Wouldn't their team catch this or address it? -
Why nobody is answering that the most normal thing to do should be redirecting via .htaccess the URL with the ending trailing hash to the one without (or viceversa)?
I mean, that's what I would do if it was just the case of the home page.
Said that, I would not worry that much, because that is one of those exact duplication cases that Google understands and solves with no problem.
-
What you could do is set up a filter in your functions.php file to change the URL based on the homepage but that's a bit too much maybe ;-). Next to that I think it's due to the fact that some web servers set up the trailing slash by default.
-
I find it strange that this happens with Yoast as it points the canonical tag for the homepage to a 301 redirect URL. I don't think it's a big problem as search engines seem to handle it well, but it's a problem that I wouldn't expect to see in such a popular and reputable SEO plugin.
If you use the plugin editor to remove the trailing slash you will remove the trailing slash from all pages of your site (something you may not want to do).
If you only want to remove the trailing slash from the homepage the easiest option would be to manually add the canonical URL without the trailing slash in the Advanced tab for Yoast when editing the homepage (as Linda said above). Doing this for one page will take you 2 seconds and fix the problem!
-
Hey Linda - I appreciate that - however when I read that article - its still seemed to open to debate if this is necessary to fix or not. Are you aware of a way to have it autofixed in wordpress? The only solution I read there was either hacking Yoast SEO to remove the trailing slash - or to manually edit every single page.
Am I over thinking this? I agreed with one poster who mentioned that Moz appears to have wanted this issue correct because their homepage shows that moz.com does not have the trailing slash in the canonical tag - nor does yoast.com.
Odd to me then that the Yoast plugin would then add this.
Are you aware of a way to remove it that is more effective?
-
A similar question has been asked here before: http://moz.com/community/q/how-do-i-get-rel-canonical-to-eliminate-the-trailing-slash-on-my-home-page .
"Login to your WordPress backend as an administrator and look for "Plugins" on the left menu and go to "Editor" within the plugins menu."
You can also edit the canonicals of individual pages and posts under the "Advanced" tab on the individual page or post editing page.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Unsolved Need Moz SEO Wordpress Plugin With API
Re: Moz WordPress Plugin? Hi guys,
Moz Pro | | mrezair
I need some Moz SEO Wordpress Plugins For my website working with Moz API. I've already found Moz DA-PA Checker plugin Moz DA-PA Checker But Need SEO Plugins too. Any Suggestion will be appreciated.0 -
Is one page with long content better than multiple pages with shorter content?
(Note, the site links are from a sandbox site and has very low DA or PA) If you look at this page, you will see at the bottom a lengthy article detailing all of the properties of the product categories in the links above. http://www.aspensecurityfasteners.com/Screws-s/432.htm My question is, is there more SEO value in having the one long article in the general product category page, or in breaking up the content and moving the sub-topics as content to the more specific sub-category pages? e.g. http://www.aspensecurityfasteners.com/Screws-Button-Head-Socket-s/1579.htm
Moz Pro | | AspenFasteners
http://www.aspensecurityfasteners.com/Screws-Cap-Screws-s/331.htm
http://www.aspensecurityfasteners.com/Screws-Captive-Panel-Scre-s/1559.htm0 -
Redirects, SEO and More
Website errors remittent of Chernobyl. First of all, I ask a lot of questions of the community and I don't do a lot of answering. For that, I am sorry! I own a small SEO company and the majority of my clients are upstarts just like myself. We try to do the best we can on a very limited budget.
Moz Pro | | underdogmike
With that said, the client website in question, http://bestdefensega.com has been a struggle to rank in the metro atlanta lawyer market.
Here's the story. My client is a new solo attorney that practices criminal law and personal injury law. We launched bestdensega.com to focus on criminal defense and my client has also paid AVVO for a website as well. We recently decided to make a monster website that would have 50+ pages and be representative of all that he practices.
I recently put a temporary redirect on bestdefensega.com and pointed it to the avvo website while I was rebuilding the website. I did this using a plugin.
This morning I decided that I wanted to remove the redirect, so I deactivated and deleted the plugin. The redirect is still in effect. I suspect that this may be a cacheing scenario.
How do I undo a redirect?
Also, I noticed that the AVVO site has all of a sudden shot up to the top of the search results and bestdefnesega.com has dropped past the 3rd page for our keywords. Have I lost all of bestdefensega.com's link juice? Also, bestdefensega.com has a spam score of 7. Why? There are no shady links and everything I do is on the up and up. Also Open Site Explorer says that bestdefensega.com doesn't have any inbound links.
Google WebMaster Tools says that the site has of 500 inbound links.. Frustrated, Thanks0 -
SEO on-demand crawl
what happened to the on-demand crawl you could do in PRO when they switched to the new MOZ site?
Moz Pro | | Vertz-Marketing0 -
In alt tag of a image can we use #hashtag or domain.com ? Is that good SEO or not allowed ?
Some of the Google Search shows a title has a hashtag of an article, which contain keyword and while tweeting them, the title which has a hashtag automatically very good used for getting traffic to the blog. And other one, can we use the hash tag inside the alt attribute ? Or our domain name with .com in it. Like Google.com or #Google ?
Moz Pro | | Esaky0 -
Does a url with no trailing slash (/)need A special redirect to the same url with a trailing slash (/)
I recently moved a website to wordpress which the wordpress default includes the trailing slash (/) after ALL urls. My url structure used to look like: www.example.com/blue-widgets Now it looks like: www.example.com/blue-widgets/ Today I checked the urls using Open Site Explorer and below is what I discovered: www.example.com/blue-widgets returned all my links, authority, etc HOWEVER there is a note that says........."Oh Hey! it looks like that URL redirects to www.example.com/blue-widgets/. Would you like to see data for that URL instead?" When I click on the link to THAT URL I get a note that says_.....NO DATA AVAILABLE FOR THIS URL._ Does this mean that www.example.com/blue-widgets/ really has NO DATA? How do I fix this?
Moz Pro | | webestate0 -
Crawled pages are missing and showing just 1 page crawled
One of my campaign has got around 8500 pages crawled(seomoz) and reports are shown, but suddenly it is showing 1 page crawled. Why it is happened like this? How can i get back the previous reports?
Moz Pro | | Sulekha0 -
Duplicate pages with canonical links still show as errors
On our CMS, there are duplicate pages such as /news, /news/, /news?page=1, /news/?page=1. From an SEO perspective, I'm not too worried, because I guess Google is pretty capable of sorting this out, but to be on the safe side, I've added canonical links. /news itself has no link, but all the other variants have links to "/news". (And if you go wild and add a bunch of random meaningless parameters, creating /news/?page=1&jim=jam&foo=bar&this=that, we will laugh at you and generate a canonical link back to "/news". We're clever like that.) So far so good. And everything appears to work fine. But SEOMoz is still flagging up errors about duplicate titles and duplicate content. If you click in, you'll see a "Note" on each error, showing that SEOMoz has found the canonical link. So SEOMoz knows the duplication isn't a problem, as we're using canonical links exactly the way they're supposed to be used, and yet is still flagging it as an error. Is this something I should be concerned about, or is it just a bug in SEOMoz?
Moz Pro | | LockyDotser0