Security Update ruins Google Adsense code.
-
Since July 23rd (when the new security update was installed) I’ve lost 75% of my Google income because the update breaks any ad code placed within a post. Is there going to be a fix for this? My blog is my sole source of income and, like most people, I can’t afford to lose 50-75% of my income. ~ karen
-
I’m not aware that WordPress has started stripping anything so would be interested to understand exactly what is happening? Then maybe we can devise a workaround
When you say “breaks”, that could mean a lot of different things. Can you see any error messages on the page? In a browser JavaScript console? Anywhere?
If nothing else, is there a URl that we could see to be able to see what’s happening ourselves?
Hi there. A few days after I stopped making money I emailed Google and this is the response I got … And I checked and they’re right. All the code snippet has been altered. I have close to 1,500 posts and without a fix, I’ll have to go in, remove the old code and insert new code. And until I do that I’m not making any money. But I suppose fixing it myself would be faster than waiting for an official fix release, especially if WordPress isn’t aware of the problem.
“Dear Karen,
Thank you for your email. Please allow me to clarify and suggest workarounds to overcome this issue:
A WordPress security update released on July 23rd broke the show_ads.js and adsbygoogle.js tags for some of our WordPress publishers. This is beyond Google’s control, but we are able to provide a workaround until WordPress releases a solution.
This WordPress security update accidentally removes line breaks from script tags that are placed within a post or page, resulting in code that looks like this:
<script type=”text/javascript”>// <![CDATA[ google_ad_client = “ca-pub-00782
For ad code that uses show_ads.js this has the effect of ad request having a property code of ca-undefined or ca-null. For code that uses adsbygoogle.js this prevents your site to complete an ad request to Google.
Until WordPress releases a solution we suggest to replace all broken ad code with newly generated code:
Remove broken AdSense tags from every WordPress post, page or widget that has a broken tag.
Copy-paste a fresh AdSense tag from AdSense frontend into every WordPress post, page or widget that had a broken tag in it and save.
Important: make sure to not switch back to the Visual Editing mode in the meantime, as that will insert the broken <![CDATA code again.
Alternatively, you can use Google’s Official AdSense plugin for WordPress to place new code which is unaffected. Note that the old ad codes need to be removed before placing new ones.I hope you find the above useful. If you are still in need of any assistance, please do not hesitate to reply to this email. I’d be happy to help.
Kindest regards,
Emily,
The Google AdSense TeamWoW! That’s crazy! Also, I’m perplexed at the how the problem occurred and the solution.
This solution indicates that the WordPress security update has, once installed, gone through every post entry in the database and stripped this information… This seems odd to me (but not impossible).
I would think that this issue would only be activated when the data is:
a) updated and saved in the database (edit a post)
b) displayed on screen (only when viewing)I’d guess that you haven’t updated every page on your website since then so that rules out (a) BUT, possibly when it renders the code it is stripping it? If this is the case, then the suggested fix by Google wont actually work.
Have you tried updating one post to see the results? If you can update the post and fix it, then clearly Google’s email is true and the update actually goes through all the posts and strips the data which is extremely poor by WordPress!
In that case, you could do a mass update directly in MySQL but you would need to understand correct syntax and use escape characters correctly AND MAKE SURE YOU BACKUP:
UPDATE wp_posts SET post_content = REPLACE(post_content, ‘[existing code]’, ‘[code to be replaced]');
If it doesn't fix it, then there is no solution until WordPress fix the bug
Hi Shannon. Yes, I’m in the process of replacing the code in all 1,500 posts. And yes replacing the code fixes it. I’m 100% sure this is a security update issue because it happened at the exact time the security update took place. And it happened in every single of my 1,500 or so posts. The same sort of thing used to happen to certain code when you flipped between the visual and text editor in a post. I like your code replace idea but at the same time am terrified by it, lol. You’d think more people would have noticed this problem or WordPress would have acknowledged it is in fact a problem. ~ k
I have the same issue for over a month now. This is a WordPress ripoff.
This post has been here around for over a month but there’s no official SAY from WordPress.This is a WordPress ripoff.
Feel free to request a refund for how much you paid WordPress… 😉
And it happened in every single of my 1,500 or so posts.
If you’re adding Adsense code directly into your posts, it’s the Tiny MCE editor that’s “breaking” the code when you switch between visual and text. While that is built into WordPress, it’s not strictly a part of WordPress. I know that’s not what you’ll all want to hear, but that’s how it is for real.
To stop this problem, don’t post Adsense (or any other sort of advertising/tracking codes) dirctly into the posts body. That’s never been the “correct” (my words, not anything offical) way that I’d ever think of doing this. Use a plugin to create shortcodes that you can put in your posts, or add the code into your template files. That way there will be no changes to any of the code that you have, and you won’t have this issue again.
The topic ‘Security Update ruins Google Adsense code.’ is closed to new replies.