Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
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
-
Pages with URL Too Long
Hello Mozzers! MOZ keeps kindly telling me the URLs are too long. However, this is largely due to the structure of E-commerce site, which has to include 'brand' 'range' and 'products' keyword. For example -
Moz Pro | | tigersohelll
https://www.choicefurnituresuperstore.co.uk/Devonshire-Rustic-Oak-Bedside-Cabinet-1-Drawer-p40668.html MOZ recommends no more than 75 characters. This means we have 25-30 characters for both the brand name and product name. Questions:
If it is an issue, how to fix it on my site?
If it's not an issue, how can we turn off this alert from MOZ?
Anyone know how big an issue URLs are as a ranking factor? I thought pretty low.0 -
Youtube traffic page url referral
Hello, How can I see which videos from Youtube that has my domain inserted in their description url drive traffic to my domain? I can see in GA how many visitors are coming from Youtube to my domain, but I can't see what Youtube video pages has driven traffic. Any help?
Moz Pro | | xeonet320 -
How to find missing or incorrect title tags with a site hosting lots of pages.
i have a website that features more than 9,000 pages. i'm trying to figure out which ones have missing or incorrect title tags. Should I start with screaming frog??
Moz Pro | | SapphireCo0 -
How to remove broken links from our wordpress site?
Hello! How are you? We just signed up to Moz.com. Moz link tool. It gave us many broken links with 404's and 302's. Could you please help me with deleting the links? Thanks!
Moz Pro | | hsma0 -
Why are inbound links not showing?
I run the site http://www.eurocheapo.com and am finding that many inbound links are not showing up in OSE and on the toolbar. For example, check out this hotel review: http://www.eurocheapo.com/paris/hotel/hotel-esmeralda.html In OSE it shows only 2 links (from 1 domain), which is crazy. It has dozens of inbound links from many different domains (links:http://www.eurocheapo.com/paris/hotel/hotel-esmeralda.html). I notice this all over my site. Pages that we link between are also showing no internal links -- which is easy to disprove. Was there a problem with this crawl? Or is the problem in our code? Many thanks for your help, Tom
Moz Pro | | TomNYC0 -
What do you use for site audit
What tools do you use for conducting a site audit? I need to do an audit on a site and the seomoz web crawler and on page optimization will takes days if not a full week to return any results. In past Ive used other tools that I could run on the fly and they would return broken links, missing htags, keyword density, server information and more. Curious as to what you all use and what you may recommend to use in conjunction with the moz tools.
Moz Pro | | anthonytjm0 -
Why do some sites have a higher Page Authority than Domain Authority in OSE??
Hi, I have noticed when using OSE and enter a domain you very often see a higher Page Authority than Domain Authority. If someone could explain why this would happen then I would be very grateful - its my current understanding that page authority would ALWAYS be LESS THAN Domain Authority but that is not always the case (I have seen cases where PA is more than 10 higher then DA) Here's an example where PA > DA http://www.opensiteexplorer.org/links.html?site=www.primelocation.com Thanks
Moz Pro | | James770 -
Use of the tilde in URLs
I just signed up for SEOMoz and sent my site through the first crawl. I use the tilde in my rewritten URLs. This threw my entire site into the Notice section 301 (permanent redirect) since each page redirects to the exact URL with the ~, not the %7e. I find conflicting information on the web - you can use the tilde in more recent coding guidelines where you couldn't in the old. It would be a huge thing to change every page in my site to use an underscore instead of a tilde int he URL. If Google is like SEOMoz and is 301 redirecting every page on the site, then I'll do it, but is it just an SEOMoz thing? I ran my site through Firebug and and all my pages show the 200 response header, not the 301 redirect. Thanks for any help you can provide.
Moz Pro | | fdb0