alex999
alex999

Reputation: 103

Many URLs with trailing double slash?

I have to check a wordpress site in Google Search Console (GSC) to find crawling problems.

Now I've seen in GSC that about 40 pages are excluded because they are redirects. The redirect is caused by a trailing double slash like http://example.com//folder1/pag1e/ (// always directly after the domain). The page http://example.com/folder1/page1/is indexed as well and without error.

I'm just wondering from where this double-slashed version of the URL comes from? Wordpress misconfiguration somehow?

Can I remove these URLs from GSC somehow?

Best regards,LEx

Upvotes: 1

Views: 2592

Answers (2)

KP Shah
KP Shah

Reputation: 11

Please check your settings-> Permalink. It should be set post name. And if it is not working then check .htaccess for redirection.

Upvotes: 1

dan webb
dan webb

Reputation: 646

Run these SQL statements. You only have to go up to the double slash, it won't affect non double slash URLS or the content after the double slash.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl//', 
'http://www.newurl/') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl//','http://www.newurl/');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl//', 
'http://www.newurl/');

UPDATE wp_postmeta SET meta_value =  
replace(meta_value,'http://www.oldurl//','http://www.newurl/');

Upvotes: 0

Related Questions