OP-Snippets
What is OP-Snippets?
OP-Snippets is a lightweight WordPress plugin developed by OptimNest. This plugin allows you to inject custom HTML, CSS, or JavaScript code into your site, without editing theme files or templates.
You can create reusable code snippets and choose:
Where to load them: in the <head>
, <body>
, or <footer>
On which pages: using exact URLs or flexible regex rules
On which devices: mobile only, desktop only, or all devices
How does it work?
SnipNest includes a built-in visual code manager with a CodeMirror editor. You can:
✅ Add and manage custom snippets easily
✅ Choose between HTML, CSS, or JS
✅ Define page visibility via URL or Regex
✅ Filter by device (mobile or desktop)
✅ Enable or disable code at any time
✅ Save everything locally and sync changes via AJAX
Safe and Efficient
SnipNest doesn’t modify any theme or template files. All snippets are stored securely in your WordPress database using update_option()
, and are injected via native WordPress hooks: wp_head
, wp_footer
, and wp_body_open
.
Use Cases
Run A/B test elements or experimental features
Add Google Analytics, Facebook Pixel, or custom tracking
Load styles or scripts only on specific pages
Insert banners, popups, or notification bars