Favourite Posts
Most Commented Posts
Stop wordpress changing your code
If you try to add google ads into your posts you will find if you edit the article and save it will mess up the code. Wordpress also changes <div> in <p>. This can be pretty annoying to say the least. Luckily I have found an easy way to stop it
To stop wordpress changing your code simple turn off the visual editor. If you go to users on your wordpress admin you will find a checkbox you can uncheck. If you sometimes have to use the visual editor you can try adding another user which you can log in as to add google ads or other coding.
I have been doing this to create some custom pages for the new release of freecss.info and it works great.
10 Responses
Thanks for highlighting the pros and cons of “visual editor” in wordpress. I use it quite a lot and have had this problem pop up several times.
thanks a lot, i was going crazy!!!! it’s just so great how people like you can save lots of hours of madness!!!
Wow thanks! I really needed this I knew wordpress was making a mistake.
Wordpress make many mistakes. But they are still the best in my opinion.
I have definitely had my fair share of problems editing Wordpress code in their built-in editor. Especially the and tags. PITA
Thanks for the tip. I don’t use AdSense but this can come handy when I have to add some code in future.
But visual editor is a need for me.
- Michael- September 2nd, 2007 at 9:00 pm
If you need to use the visual editor you can set up a new user and use it only with code editor.








Use one of the adsense manager plugins. It makes it very easy and you don’t run into bugs like that.
Although I still wrestle with the dang into . Not sure why it does that, but it prevents me from doing any tweaked customization.