How to: Remove wpmp_switcher strings from your Blog URLs

Here is a guide on how to remove wpmp_switcher strings from your blog urls created by WordPress Mobile Pack plugin. These strings get generated at the end of all your site urls so that the plugin can display your mobile site and the desktop version of the site to the users.

Although WordPress Mobile Pack is a great plugin for making your site mobile friendly, but one serious con is that it doesn’t handle the url parameters very well. You might have seen the strings ?wpmp_switcher=mobile and ?wpmp_switcher=desktop attached to the end of your urls when you change back and from the mobile version and desktop version of your site respectively.

You might not know but these strings can actually hamper your blog growth in an SEO point of view. For example, when you visit the Google Webmaster Tools, and check out the crawl errors, then you might see a huge list of such kind of urls. The plugin doesn’t even do a good job of no-following these urls.

remove wpmp switcher strings from your blog urls gwt screenshot 1 How to: Remove wpmp switcher strings from your Blog URLs

I had to find out the hard way on how to remove these urls from my blog permanently.

So, to fix these errors easily, follow the steps given below.

Step 1: Deactivate the WordPress Mobile Pack plugin and delete the plugin files.

Step 2: Add the following lines to your robots.txt file so that search engines stop crawling wpmp urls

Disallow: *?wpmp_switcher

Step 3: Add a redirection in your .htaccess file so that when someone visits an url say, http://www.revthatup.com/?wpmp_switcher=mobile then it will automatically get redirected to the original url i.e. http://www.revthatup.com/

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{QUERY_STRING} ^wpmp_.* [NC,OR]
RewriteCond %{QUERY_STRING} (. )&?wpmp_.*$ [NC]
RewriteRule ^(.*)$ $1?%1 [R=301,L]
</IfModule>

NOTE: Please add the above redirection rule at the very top of your .htaccess file, even before the WordPress rules.

Step 4: Check to see if everything is working fine by signing in to your Google Webmaster Tools and clicking Fetch as Google under the Health tab.

Here specify any url of your blog page and add the characters ?wpmp_switcher=mobile at the end of the url. Now press the big red FETCH button and wait for the request to be completed. After some seconds you should see something like this:

remove wpmp switcher strings from your blog urls gwt screenshot 2 How to: Remove wpmp switcher strings from your Blog URLs

Make sure those type of urls are being denied by robots.txt as seen in the pic above. If you are getting the denied by robots message then it is a signal that everything is working fine. Additionally you may also want to check if the redirection is working, by clicking the url you tested above.

End of tutorial.

Thats it! Now you have successfully gotten rid of all the wpmp_switcher urls on your blog.

An alternative to the WordPress Mobile Pack plugin is, WPtouch which works fine and doesn’t add those annoying strings at the end of urls.

If you have any questions or need further assistance feel free to drop by! For more such useful tutorials, subscribe to our newsletter.

Subscribe to our Weekly Newsletter

I take your privacy very seriously

Comments

  1. karthik Reply

    very useful post for those who use wordpress mobile pack !

  2. karthik Reply

    gautam it will be useful if you say which plugin do you use to display related posts on your blog

  3. Salem Reply

    I have big issue with wpmp_switcher=mobile URL
    I tried Your .htaccess file code but it didn’t work
    It Give Me Error 500 after use it

  4. Bogdan Reply

    same problem… error 500….

    my htaccess file:

    # BEGIN WordPress

    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^wpmp_.* [NC,OR]
    RewriteCond %{QUERY_STRING} (. )&?wpmp_.*$ [NC]
    RewriteRule ^(.*)$ $1?%1 [R=301,L]
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  5. david Reply

    Same problem, error 500 when i put you code in my .htacces file.
    (i also use wp super cache ).
    Regards.

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail.