homepage Welcome to WebmasterWorld Guest from 50.17.177.99
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

    
Weird Permalink Thing
SEO2Go




msg:4426553
 4:55 pm on Mar 8, 2012 (gmt 0)

I saw something odd in Google Webmaster Tools when I was looking under HTML suggestions...

A couple of my pages are showing duplicate meta descriptions. When I looked at the urls I couldn't believe what I was seeing.

and example of the original is:
mysite.com/widgets/redwidgets/

and the other one is listed as:

mysite.com/widgets/redwidgets/20/

No matter what I change the trailing number to it shows the same page. I have no idea why.

I removed the contents of my .htaccess file and I removed all of my plugins, but the problem persists.

Has anyone ever seen this before? Is this considered duplicate content?

 

lorax




msg:4426556
 5:06 pm on Mar 8, 2012 (gmt 0)

What are your permalinks set to?

SEO2Go




msg:4426557
 5:10 pm on Mar 8, 2012 (gmt 0)

Custom: /%category%/%postname%/

SEO2Go




msg:4426563
 5:21 pm on Mar 8, 2012 (gmt 0)

Actually. I was just playing with urls from wordpress sites that do not belong to me and they seem to also do the same thing.

lorax




msg:4426955
 1:05 pm on Mar 9, 2012 (gmt 0)

Well, WP uses numeric IDs for posts so I'm not surprized it finds the post using an ID. I don't think it's an issue - maybe an undocumented feature. But as long as your links use the permalink structure then you should be fine and the IDs will never get indexed.

rocknbil




msg:4427042
 4:39 pm on Mar 9, 2012 (gmt 0)

Then why would they show up in WMT?

I just checked a W.P site using permalinks and yeah, it's doing the same thing. What the heck . . .

I'd try to write some sort of 301 that rewrites any trailing numeric URL's to the ones without it, unless you actually have any that end in numbers.

Here's what I came up with on a development site (not "live") but my permalink structure is just /%postname%/

ReWriteRule ^(.+)\/\d+\/?$ /$1 [R=301,L]

Seems to work without breaking anything but it's only **one** number after the permalink. What's the likelihood of postname/1/2?

mslina2002




msg:4427063
 5:26 pm on Mar 9, 2012 (gmt 0)

What is happening is actually a problem I have seen when I activated the <!--nextpage--> quick tag.

After I started using the tag I started seeing these errors come up in WMT as well. But what the nextpage tag did was allowed me to break up my long POST into paginated pages , the subsequent pages are thus labeled www.example.com/longpost/2/ for page 2, www.example.com/longpost/3/ for page 3. Not sure if that applies to you or any other pagination plugin you're using but that was where I encountered the problem.

FIX 1:
You can fix that to prevent having duplicate meta and title tag by using a canonical plugin like Yoast WordPress SEO plugin. If you don't have paginated posts or pages this should do the trick.

FIX 2:
If you have paginated posts as well, then you can also try using ZB Phantom Toolkit (ZipsBazaar) where any phantom pages e.g. pg 100 will always be redirected to the last authentic page in a post or page. Or rocknbil solution above - didn't try that one yet.

I don't know where these so called phantom pages come from either through bots that are malicious or actual scumbags typing/linking to these pages. I have seen pages go out to /29/ even.

[edited by: lorax at 9:34 pm (utc) on Mar 9, 2012]

not2easy




msg:4427109
 7:12 pm on Mar 9, 2012 (gmt 0)

I second the suggestion for using the Yoast SEO plugin, it lets you keep multiple versions of pages/posts out of your sitemaps. WP offers multiple ways to link to things which is great for users but not for sitemaps. Check the sitemap that you have now to see if those URIs are in the sitemaps.

lorax




msg:4427172
 9:32 pm on Mar 9, 2012 (gmt 0)

@rocknbill - Good point. If it shows up in WMT there must be a link to them somewhere? I'm guessing here but how else would Google find it? How many pages (rough %) of the total are showing up with numeric IDs?

SEO2Go




msg:4427595
 8:04 pm on Mar 10, 2012 (gmt 0)

Seems to work without breaking anything but it's only **one** number after the permalink. What's the likelihood of postname/1/2?


I can type any number after the slash and it comes up with that page. Since it showed up in webmaster tools, that concerns me.

I will try the Yoast plugin. Thanks for the suggestion. I hope it works.

SEO2Go




msg:4427600
 8:08 pm on Mar 10, 2012 (gmt 0)

I just tried rocknbil's suggestion and it worked. Thanks a million.

SEO2Go




msg:4428054
 9:55 am on Mar 12, 2012 (gmt 0)

One problem I just discovered with this solution is that it breaks pagination at the bottom of the page. I had to remove it.

iamzippy




msg:4429924
 2:15 pm on Mar 16, 2012 (gmt 0)

With WordPress' pretty permalinks, there are 3 discrete paging syntaxes -- for the Home Page, for paged Post or Page content, and for paged comments.

A page ordinal suffix of /0/ is always invalid, and /1/ is redundant. But both /0/ and /1/ (or any number, really) can usually sit happily in the address bar and cause issues of 'duplication'. You can test this on just about any WordPress blog out there right now. I recommend always having redirection in place for requests for pages /0/ and /1/.

The Home or Front Page only becomes 'paged' once the number of posts exceeds nn in Settings > Reading > Blog pages show at most [nn] posts. The suffix syntax for a sub-page of the Home Page is:

home_url/page/nn/

To redirect Home/Frontpage pages 0/1:

RewriteRule ^(page\/)?[01]\/$ / [R=301,L]


Posts and Pages become paged when you insert the <!--nextpage--> tag into the content. The suffix syntax for the second and subsequent pages simply tacks a numeric segment on the end of the URL:

home_url/path/to/post-or-page/nn/

To redirect Page or Post pages 0/1:

RewriteRule ^(?!page)(.+?)\/[01]\/?$ $1/ [R=301,L]


Post or Pages with comments are split into comment-pages according to Settings > Discussion > Break comments into pages with [nn] top level comments per page. The suffix syntax for second and subsequent pages here is:

home_url/path/to/post-or-page/comment-page-nn/#comments

To redirect paged-comments pages 0/1:

RewriteRule ^(.+?)\/comment-page-[01]\/?(#comments)?$ $1/$2 [R=301,L]

If your blog doesn't require any paging support at all, you can replace [01] with \d+ in each RewriteRule above to redirect ANY page-number suffix to the canonical post or page URL.

This is a very basic level of protection. If you do rely on any of WordPress' paging functionality, you can run into another problem -- paged URLs with ordinals that might be out-of-bounds at the high end. Say you have a Wordpress Page that's split into 3 sub-pages, and all 3 are indexed in the SEs. You later chop some waffle out of that Page, so it's now just a 2-page Page. How do you explain where page 3 went?

The plot thickens. What's to stop anyone posting malicious links to stupidly high page numbers (whether the content is really paged or not)? To fix that issue, you need to load WordPress so you can access the requested content and test the page number in the URL against the true number of pages.

For that, you will need a plugin.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved