Relevant Adsense Ads on main page
-
Hi all,
just worked out something and thought id share it with everyone. Any new WP site i created, regardless of theme, would not display relevant adsense ads on the main page https://www.xxxxxx.com (they only showed ads about wordpress etc) however if i typed in https://www.xxxxxx.com/index.php directly the ads would be relevant. I read many posts from people with the same issue but no real solution – some people said it would just fix itself after some time – maybe related to Google indexing it? But i found after weeks it still was not fixed.
Anyway, i believe i found the fix for it. You need to overide the home and siteurl DB settings. Edit your wp-config.php file in the wordpress install root and add the following lines of code after the existing DEFINE statements at the top. This is if you installed WP into a subdirectory:
define('WP_SITEURL', 'https://www.sample.com/wordpress'); define('WP_HOME', 'https://www.sample.com');
Obviously you need to put your own site in there. If your WP install is not in a subdirectory then it should just be like this:
define('WP_SITEURL', 'https://www.sample.com'); define('WP_HOME', 'https://www.sample.com');
That’s it, after saving those changes the ads immediately become relevant for the home url https://www.xxxxxx.com, just like the /index.php url shows.
let me know if it works for you or not.
cheers
- The topic ‘Relevant Adsense Ads on main page’ is closed to new replies.