Add Mobile Redirect to a WordPress site

Overview

This article contains instructions on how to add your mobile redirect script to a self-hosted website built with Wordpress.org.  Please note this method is not compatible with hosted Wordpress.com websites.

Steps

1. Login to your WordPress dashboard, this is usuallyhttp://www.yoursite.com/wp-admin

2. On the left side, click Appearance

3. Then click Editor

Once this is done, 

1. On the right side, find the HEADER.PHP FILE.

2. In the header.php file, find the <head> tag. This is usually a few lines from the top.

3. Paste the following redirect code immediately after the <head> tag:

1 <script src="http://static.mobilewebsiteserver.com/redirect.js"type="text/javascript"></script>
2 <script type="text/javascript">Mobile_redirect("http://m.example.com");</script>

4. Be sure to replace http://m.example.com with your mobile URL

5. Click update file at the bottom.

Once this file updates, your WordPress installation should redirect visitors to your mobile site!