Mobile app version of vmapp.org
Login or Join
Twilah146

: Google is including a wrong & misleading URL in search results for my WordPress site WordPress apparently will resolve partial URLs to the "correct" page when entered at the parent level. Google

@Twilah146

Posted in: #Seo #Url #Wordpress

WordPress apparently will resolve partial URLs to the "correct" page when entered at the parent level. Google is including this partial URL in its search results. For example, years ago I wrote a blog post about a site called Bookeo:
www.example.com/2011/04/bookeo/

If you type in this it will resolve to the above URL.
www.example.com/book/

For some reason Google actually cached the /book/ URL, as if it's its own page. If you search my sitename + book it returns the shortened, incorrect URL. This is the last thing I want since people might go there expecting to book an appointment or something.

As an aside WP actually resolves to the first result that matches. So if you had blog posts with /book1/ and /book2/ it'd pick the first one.

Is there a way to make Google only cache the correct destination URL? The sitemap only includes the right one and is linked in robots.txt. I just manually submitted it to Google webmaster as well.

Is my only option to update robots.txt to block /book. Or figure out how to disable that URL resolution functionality in WordPress?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Twilah146

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pierce454

The first comment suggests I should figure out how to disable the URL guess feature in WordPress. I think that is the best solution. One way to do so is answered here.
wordpress.stackexchange.com/questions/92103/disable-wordpress-url-auto-complete
remove_filter('template_redirect', 'redirect_canonical');


But it comes with admonitions on reasons you shouldn't, as this disables the entire feature which comes with many SEO benefits, such as preventing duplicate URL penalties. The part of it I don't want is:


Will also attempt to find the correct link when a user enters a URL that does not exist based on exact WordPress query. Will instead try to parse the URL or query in an attempt to figure the correct page to go to.


Apparently there's an open WordPress ticket on it. A workaround can be found here, as well as a similar one in the above link.
core.trac.wordpress.org/ticket/16557
function remove_redirect_guess_404_permalink( $redirect_url ) {
if ( is_404() )
return false;
return $redirect_url;
}
add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink' );

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme