Install HalalSpark on WordPress
For self-hosted WordPress sites (WordPress.org). You do not need to edit code directly — everything is done through the WordPress dashboard.
Using WordPress.com?
Some WordPress.com plans restrict custom code and plugin installation. If you cannot install plugins or add Custom HTML blocks, check your plan before continuing.
Your website must be approved before ads can serve. If you have not added your site yet:
- Go to your HalalSpark dashboard
- Click Add Website
- Submit for review
Approval usually takes up to 24 hours. You will be notified when complete.
Auto Ads
Add one script to your WordPress site.
HalalSpark handles placement automatically.
You only need to add this script once. WordPress loads it on every page automatically — posts, pages, archives, and all — because all themes share a single header template.
Control ad types, density, and page rules from your dashboard.
Get your Auto Ads script
- Go to your HalalSpark Publisher Dashboard
- Click your website
- Open the Set Up Ads tab
- Select Auto Ads and complete the setup steps
- Copy your script from the final screen
If setup is already complete:
- Go to your website → Placements tab
- Click Copy Script next to your Auto Ads configuration
<script src="https://ads.halalspark.co.uk/get-auto-ads-script?websiteId=YOUR_WEBSITE_ID" async></script>YOUR_WEBSITE_ID is unique to your site. Copy the script exactly as shown. Do not edit it.Install a header injection plugin
You need a plugin to add code to your site header. This is the safest method and does not require editing theme files.
- Go to your WordPress dashboard
- Click Plugins → Add New
- Search for a header injection plugin such as WPCode or Insert Headers and Footers
- Install and activate it
Paste the script into the Header section
Open your plugin's settings and find the Header section. Paste your Auto Ads script there and save.
The exact location depends on your plugin. Look for a field labelled Header, Scripts in Header, or Head Code.
async attribute. Without it, the script can block your page from loading.Clear your cache
If you use a caching plugin (such as WP Super Cache, W3 Total Cache, or LiteSpeed Cache), clear your cache after saving.
Check your installation
- Open your site in a new tab
- Ads should appear within a few seconds
- If nothing appears, add
?test=1to your URL to preview, or see troubleshooting below
Adjust settings any time
You can change your settings at any time from the Placements tab in your dashboard:
- Ad density — number of ads per page
- Ad types — inline, banner, header, footer, sidebar
- Page rules — include or exclude specific URLs (only relevant if your script is active across your whole site)
Changes apply immediately. No plugin updates required.
&profile=NAME) that you paste into the relevant WordPress template. Set them up in your dashboard under Set Up Ads → Auto Ads → Add Profile. Full details in the Auto Ads guide.- Preview mode
- Add
?test=1to your page URL. Ads show with a TEST label. No impressions are recorded. - Debug mode
- Add
?debug=trueto your page URL. Open your browser console to view logs and placement decisions.
Advanced — Theme File Editor
If you need to add the script directly to your theme:
- Go to Appearance → Theme File Editor
- Open
header.php - Find the closing
</head>tag - Paste your script directly before it
- Click Update File
Manual Ads
Place ads exactly where you want them in WordPress.
Where the ad should appear determines how you add it. Follow the path that matches your placement.
Manual Ads do not use plugins. They are added directly to your content or layout.
Custom HTML block or widget — not a paragraph or text field. Pasting your script as regular text will display it as visible code on your page.Path A — In a post or page
Use this method to place an ad inside the content of a post or page — for example, between paragraphs in an article.
Create a placement and get your script
- Go to your HalalSpark Publisher Dashboard
- Click your website
- Open the Set Up Ads tab
- Select Manual Ads, choose an ad type, and complete the setup
- Copy your script from the final screen
If the placement already exists:
- Go to your website → Placements tab
- Click Copy next to the placement you want to install
<script src="https://ads.halalspark.co.uk/get-ad-script-banner?placement_id=YOUR_PLACEMENT_ID&domain=yourdomain.com&_v=3.0" async></script>domain= value must match your registered domain exactly.example.com and www.example.com are treated as different values. A mismatch will prevent ads from serving.Open the post or page
Go to Posts or Pages in your WordPress dashboard and open the one where the ad should appear. Click Edit.
Add a Custom HTML block
In the editor, click + to add a new block. Search for Custom HTML and select it.
Place the block at the exact position where the ad should appear — for example, between two paragraphs.
Custom HTML block, not a Paragraph block. Pasting your script into a Paragraph block will display it as visible text on your page.Paste your script
Click inside the Custom HTML block and paste your script.
Save
Click Update (or Publish if this is a new post or page).
Path B — In a sidebar or footer
Use this method to place an ad in a widget area — for example, a sidebar column or your site footer.
Create a placement and get your script
- Go to your HalalSpark Publisher Dashboard
- Click your website
- Open the Set Up Ads tab
- Select Manual Ads, choose an ad type, and complete the setup
- Copy your script from the final screen
If the placement already exists:
- Go to your website → Placements tab
- Click Copy next to the placement you want to install
<script src="https://ads.halalspark.co.uk/get-ad-script-banner?placement_id=YOUR_PLACEMENT_ID&domain=yourdomain.com&_v=3.0" async></script>domain= value must match your registered domain exactly.example.com and www.example.com are treated as different values. A mismatch will prevent ads from serving.Open Widgets
Go to Appearance → Widgets in your WordPress dashboard.
Add a Custom HTML widget
Find the widget area where the ad should appear, such as Sidebar or Footer.
Click + to add a new widget. Search for Custom HTML and select it.
Paste your script
Click inside the Custom HTML widget and paste your script.
Save
Click Update.
- Preview mode
- Add
&test=1to the script URL. The ad renders with a TEST label. No impression is recorded. - Debug mode
- Add
&debug=1to the script URL. Open your browser console to see the targeting decision for that placement.
Ads not showing?
Work through this checklist before raising a support request.
Script placement
- Auto Ads script is in your plugin's Header section — not Body or Footer
- Manual Ads scripts are in a Custom HTML block or Custom HTML widget — not a Paragraph block or plain text field
- The
asyncattribute is present on the script tag - The script URL uses
ads.halalspark.co.uk
Cache
- Clear your caching plugin after any changes — W3 Total Cache, WP Super Cache, LiteSpeed Cache, or whichever you use
- If your host has server-level caching, clear that too
Domain & approval
- Your website is approved in your HalalSpark dashboard — the Set Up Ads tab only unlocks after approval
- The
domain=value matches your registered domain exactly —wwwprefix matters
Page rules & ad match
- The current page is not excluded by a page rule in your Auto Ads settings
- A placeholder ad means no paid campaign currently matches your content — this is normal and will resolve as more campaigns go live
Browser & extensions
- Disable ad blockers and privacy extensions, then reload
- Test in a private browsing window with all extensions off
WordPress-specific
- If you edited theme files directly, check that your changes were not overwritten by a theme update
- If a recently installed or updated plugin is causing a conflict, try disabling plugins one by one to isolate the issue
Debug tools
- Auto Ads: add
?debug=trueto your page URL → open browser console - Manual Ads: add
&debug=1to the script URL → open browser console - DevTools → Network tab → filter for
halalsparkto check requests and responses