cant save javascript ad code in my widget and in posts
-
i have javascript codes from my advertizing companies which i am suppose to put in my widget for ad display. but wordpress wont allow. when the script is placed in widgets, the save process will spin for eternity without saving. when the script is placed in posts where i want my ads to appear, it will generate error such as page not found. wordpress dont allow javascript
I NEED HELP……
-
This topic was modified 6 years, 9 months ago by
princewebx.
-
This topic was modified 6 years, 9 months ago by
-
WordPress does allow JavaScript, if you have a self-hosted WordPress.org site.
If your site is hosted on WordPress.com, they do not allow JavaScript.
To clear up any confusion, WordPress.com and WordPress.org are two different entities: https://wordpress.org/support/article/wordpress-vs-wordpress-com/
Assuming you have a self-hosted WordPress.org site, this would suggest that something is very wrong in the code being provided.
Which ad company provided the code?
Alternatively, you may find it easier to just use a plugin like https://wordpress.org/plugins/ad-code-manager/ or https://wordpress.org/plugins/advanced-ads/ instead.
@macmanx thank you for replying. i have a self hosted wordpress.org site and have tried all the plugins you have suggested and even more but still no result.
this is sample of the ad script i am suppose to place in my widget but wordpress isnt allowing.
<script data-cfasync=”false” type=”text/javascript” src=”https://www.geniusdexchange.com/a/display.php?r=3103139″></script>
Something seems to be wrong with the ad code,
https://www.geniusdexchange.com/a/display.php?r=3103139is returning an empty result, both in the browser and cURL.Have you spoken to the ad provider about this?
Their main domain also returns a 403 Access Denied.
script codes from adsense ads is also not supported. tho i use those scripts on other places apart from wordpress self hosted sites. the problem is not the scripts, its wordpress not allowing the scripts. and i am not the only one facing this challenge. it was working in the previous versions of wordpress but not anymore. i need help @macmanx
I definitely have no trouble with AdSense code on any of my sites under WordPress 5.2.2, so it must be either something on your end, or how you’re adding the code.
In this case, I suggest using a plugin like https://wordpress.org/plugins/ad-code-manager/ or https://wordpress.org/plugins/advanced-ads/ instead.
They will work, and they will provide far more flexible options than simply inserting the code yourself.
thanks very much for your replies. but i have tried them all and whenever i tried them and save, it will give a page not found feedback
If it’s not even working in the plugin, then something is indeed very wrong either on your end or with the ad code.
I suggest reaching out to the support for whichever plugin you tried:
okay, thanks for your support
The topic ‘cant save javascript ad code in my widget and in posts’ is closed to new replies.