I was recently developing a blogger blog template for a client and I faced a strange problem. Whenever I tried to insert adsense code directly into the blogger template,
- Either it would not show up at all,
- Or an XML not well formed error messages, like the following, were displayed.
“Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The content of elements must consist of well-formed character data or markup.”
“Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The processing instruction target matching â€œ[pP][qQ][rR]â€ is not allowed.”
- < by <
- > by >
- and so on.
The converted code worked perfectly fine with the blogger template. I inserted it in various positions, including the main content area and the sidebar, and it worked each time.
So, finally the solution to this issue is to replace certain characters like <, > etc. to their respective HTML entities. Now, it took me a lot of time to convert the adsense code to this working format. So I created this tool.
Adsense Code Coverter For Blogger Blogs
What is Adsense Code Converter For Blogger Blogs
Note – Please note that you should always backup your blogger template before making any changes to it.
Can it convert Adbrite’s ad code?
If I use this, will I break any AdSense program policies?
No. Using this tool doesn’t breaks AdSense program policies because you are NOT modifying the ad code in any way. To be sure, use the encoded code in your template and then view source of the page. You’ll find no change in the ad code.
You can access this tool here.
Please leave your suggestions and feedback using the comments.