Add custom scripts to your pages
Scripts Manager adds fields for code in the page <head> and near the end of <body>. You can set code sitewide, on a post type archive, or on an individual post, page, or term. It also lets you add body classes and turn off registered plugin assets on selected pages.
Before you start
- You need an Administrator account on a site running Marketers Delight 6.0 or later.
- Scripts Manager also requires WordPress 6.2 or later and PHP 7.4 or later.
- Install and activate the Scripts Manager Drop-in.
- Have the code or CSS class names you want to add ready.
Add sitewide code
- Go to Theme → Settings.
- Open Scripts.
- Enter any Body classes you want on every page.
- Enter code in Header Scripts for the page
<head>, or in Footer Scripts for the end of the page. - Select Save.
| Field | Where its value appears |
|---|---|
| Body classes | In the page's <body> class list |
| Header Scripts | In <head>, before the opening <body> tag |
| Footer Scripts | After <footer>, before the closing </body> tag |
Add code to an archive or one page
For a post type archive, go to that post type's Settings screen and open Scripts. For a category or taxonomy archive, open its edit screen and find Scripts in its page settings. For an individual post or page, open Page Settings below the editor, then open Scripts. Each place has Body classes, Header Scripts, and Footer Scripts.
Page-specific scripts are added after the sitewide scripts; they do not replace them.
Turn off registered plugin assets
Scripts Optimization can turn off selected plugin scripts and styles on single posts and category or taxonomy archives. Its checkboxes appear only when a plugin has been registered with the md_filter_dequeue_scripts filter. If the section is absent, there are no registered choices to select.
Check the result
Open the affected page and inspect the relevant part of its HTML: <head>, the <body> classes, or the code before </body>. If your code is missing, check that you entered it in the intended sitewide or page-specific field and saved that screen. If Scripts Optimization is missing, check whether a plugin has been registered for it. If you use a caching plugin, clear its cache and reload.

