Set up StyleScript
StyleScript is the free plugin WorkMore StyleScript: your site-wide CSS,
JavaScript and the code that belongs in <head>, right after <body> and
before </body>, in a real code editor with preview, history and safe
mode — complete on its own. WorkMore StyleScript Pro, an add-on to it,
adds code for single pages and ready-made effects; its steps are at the
end of this page.
What you need
- WordPress 6.0 or newer and PHP 7.4 or newer.
- An administrator who may add unfiltered HTML: every administrator of a single site, or a network administrator on a multisite. Other administrators see the code read-only.
- The free plugin. While WordPress.org reviews it, download it here: workmore-stylescript-1.0.0.zip. Once it is listed, install it from Plugins → Add New instead; a site that installed this zip updates from WordPress.org on its own — it is the same plugin, under the same name.
1. Install the free plugin
- Plugins → Add New → Upload Plugin, choose the zip, Install Now, Activate.
- Open Appearance → StyleScript. The CSS, JavaScript and
Header & Footer tabs are the boxes; Header & Footer has three:
In
<head>, After<body>and Before</body>.
2. Write, preview, save
- Write your CSS in the CSS tab.
- Press Preview to see your real site beside the editor, with the code you have not saved yet — only you see it. CSS changes as you type; JavaScript and markup run when you press Run preview. The buttons above the page switch between desktop, tablet and phone widths.
- Press Save, or Ctrl/Cmd+S. The code is live at once, and the page caches of common caching plugins and hosts are cleared. If your host caches pages some other way, clear that cache after saving.
Pasted a whole <script> or <style> block into the wrong box? The box
says so and fixes it in one click. JavaScript has options under the editor:
where it loads, whether it waits for the page, and whether it needs jQuery.
3. Bring in the code you already have
Tools → Bring in code from elsewhere finds the Customizer's Additional CSS and Flatsome's custom CSS and header and footer scripts, shows what it found, and moves it into the boxes after what they already hold. By default the original is emptied, so the code does not run twice. Every box keeps its history, so the move can be undone.
To move everything to another site, Tools → Export and import: an import shows what will change before anything is saved.
If something breaks
- History, in every box: compare an earlier version with the editor, line by line, and restore it.
- Tools → Open the site without custom code: the site without any of it — only you, only in that window.
- Settings → Print the custom code on the site: untick it to take all of it off for everyone, without losing anything.
- The dashboard is out of reach: add
define( 'WMSS_SAFE_MODE', true );towp-config.php, or runwp stylescript safe-mode on. Nothing is deleted.
Pro
- Buy a plan on the pricing page. Freemius, our merchant of record, emails your license key and a link to the add-on.
- Download the add-on from that email (the zip's name starts with
workmore-stylescript-pro). Plugins → Add New → Upload Plugin, choose the zip, Install Now, Activate. The free plugin must stay installed and active: Pro is an add-on to it. WordPress 6.5 and newer enforce this; on older versions the add-on shows a notice that says what to do. - Paste the license key from your purchase email when the add-on asks. The same screen opens from Activate License under the add-on in the Plugins list, and from Appearance → StyleScript → Pro → Activate your license.
- Appearance → StyleScript now has an Effects tab, and every post, page and WooCommerce product has a StyleScript — code for this page box in its editor. The Pro tab shows your license.
Updates and sites
- The add-on updates from Plugins → Updates while your subscription is active.
- If the subscription lapses, nothing breaks: the code for single pages and the effects you set up keep running and stay editable. Updates, and adding new Pro code or effects, wait until you renew — the Pro tab has the button.
- A license covers the number of sites of its plan, and local and staging copies of a site do not count. To move a license, deactivate it on the old site (Pro → Manage account) and activate it on the new one.
- Remove the add-on whenever you like: the free plugin keeps your site-wide code working. Code for single pages and effects stop printing but stay stored — unless you ticked Settings → Uninstall — and come back when you reinstall Pro.
Uninstall
Deactivating never deletes anything. Uninstalling removes the code, its history and the settings only if you ticked Settings → Uninstall; otherwise everything stays for a later reinstall.