1. Help Center
  2. Sanil Ads Kit
  3. Troubleshooting

AdSense or script ads are saved as HTML

Updated
Applies to
Sanil Ads Kit 1.0.0
Reading time
1 min

You choose Google AdSense or Script / Embed as the ad type, save, and find the ad has become HTML, so the AdSense code does not run.

Why it happens

AdSense and Script / Embed ads output raw code, which can contain scripts. WordPress only lets users with the unfiltered HTML permission save raw scripts. This is normally administrators on a single site. If you save such an ad without that permission, Sanil Ads Kit stores it as an HTML ad instead of keeping a script you are not allowed to publish.

Fix it

  1. Sign in as an administrator. On a multisite network, use a super admin account.
  2. Open the ad. Set Ad Type to Google AdSense or Script / Embed again.
  3. Paste the code and save. Paste it into Ad Content. The type now stays.

If an administrator still cannot save it

Some sites turn the permission off for everyone by adding DISALLOW_UNFILTERED_HTML to wp-config.php. Remove that line, or ask your host to, if you need script ads.

Note

Only paste code from sources you trust. A script ad runs on every page where the ad shows.

Was this article helpful?