Add Mobile Redirect to a WordPress site


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


1. Login to your WordPress dashboard, this is usually

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=""type="text/javascript"></script>
2 <script type="text/javascript">Mobile_redirect("");</script>

4. Be sure to replace 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!