#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jan 2018
    Posts
    15
    Rep Power
    0

    WordPress - Trailing slash URL issue


    Has anyone had an issue where WordPress is creating a trailing and non-trailing slash URL?

    www.example.com/blog-post
    www.example.com/blog-post/

    Obviously there's a need to 301 one of these to the other, but is there something in WordPress that needs to be turned off or altered to stop it doing this? Or automatically 301ing the '/' version for example.

    I'm dealing with about 200 pages here so there must be a simple solution that I've missed.

    Thanks in advance :-)

    H
  2. #2
  3. No Profile Picture
    Registered User

    Join Date
    Mar 2018
    Posts
    12
    Rep Power
    0
    Both URL's should take you to the same place. Don't worry about it.

    Comments on this post

    • KnowOneSpecial : Not good advice....
  4. #3
  5. No Profile Picture
    Moderator
    SEO Chat Scholar (3000 - 3499 posts)

    Join Date
    Sep 2016
    Location
    USA
    Posts
    3,202
    Rep Power
    3708
    If you don't worry about it, Google will be confused about which page to rank and split the juice between them.

    There are two ways you can handle this ... I would recommend #1

    1. Use a rewrite in your htaccess to add the trailing slash or remove the trailing slash ( My first choice ! ) This solution fixes all pages asap, and all future pages in the future.

    or

    2, Use a rel = canonical on the page you do not want. So if you don't want the trailing slash page to get the juice, put the rel = canonical on it and point it to the page with out the slash.
    This solution adds 1 line of code to each page, so you page size increases, but only by a few bytes.
  6. #4
  7. No Profile Picture
    Registered User

    Join Date
    Mar 2018
    Posts
    12
    Rep Power
    0
    Wordpress automatically puts the rel="canonical" tag in the header.
  8. #5
  9. No Profile Picture
    Moderator
    SEO Chat Scholar (3000 - 3499 posts)

    Join Date
    Sep 2016
    Location
    USA
    Posts
    3,202
    Rep Power
    3708
    Actually it is not WordPress you really need to worry about....

    Originally Posted by Melissa Ritter
    Wordpress automatically puts the rel="canonical" tag in the header.
    All of the following pages are the exact same home page, with different way to reference them. This is why I recommend doing the fix in the htaccess file. It is a very much cleaner solution !

    http://example.com
    http://www.example.com

    https://example.com
    https://www.example.com

    http://example.com/
    http://www.example.com/

    https://example.com/
    https://www.example.com/

    http://example.com/index.php
    http://www.example.com/index.php

    https://example.com/index.php
    https://www.example.com/index.php

Similar Threads

  1. trailing slash
    By iandavid in forum New User SEO Questions and Answers
    Replies: 4
    Last Post: Mar 13th, 2017, 01:02 PM
  2. Replies: 9
    Last Post: Nov 11th, 2011, 08:07 AM
  3. Trailing slash and SEO - canonical issue
    By Tommy N in forum Google Optimization
    Replies: 2
    Last Post: Sep 21st, 2011, 01:25 PM
  4. Trailing slash at end of url
    By Hilary in forum Web Design, Coding and Programming
    Replies: 3
    Last Post: Oct 5th, 2010, 11:48 AM
  5. The trailing slash
    By Robin Hood in forum Google Optimization
    Replies: 3
    Last Post: May 8th, 2008, 03:05 PM

IMN logo majestic logo threadwatch logo seochat tools logo