
WP Smart Content
Skildring
Inject scripts, styles, HTML, CSS, or tracking code into headers, footers, sidebars, block hooks, and shortcodes. Supports PHP hooks, WP 6.8 Block Hooks, snippets, scheduling, revisioning.
⏱ Schedule when you want
Every Smart Content block can be named, prioritized, scheduled, and stored safely in the WordPress database. Target blocks to specific posts or pages, or apply them globally across your site. Define start and end dates so snippets appear only when needed — ideal for campaigns, seasonal banners, or compliance notices.
📍 Publish where you want
Behind the scenes, WP Smart Content injects your HTML, JavaScript, or CSS styles into the selected WordPress hook — whether a classic theme hook or a modern Block Hook. Your content appears exactly where you want it, only for the time you want it, without modifying templates. You can also embed Smart Content blocks directly inside posts, pages, or widgets using a shortcode. This keeps your site secure, SEO-friendly, and easy to maintain.
🔒 Manage safely by whom you want
Administrators have full control with access to both Raw Mode (unfiltered output) and Safe Mode (sanitized injection). Trusted non-administrators can be granted limited access to pre-created blocks in Safe Mode by assigning the «wpsc_admin» capability to their role, either through a role editor plugin or custom code. This makes it easy to delegate tasks securely — for example, handing over CSS styling to a designer without exposing broader site settings or sensitive scripts.
🗂 Revision when you want
WP Smart Content now supports full revision management for editor content inside a block. You can retrieve and navigate through previously saved revisions of block content, compare changes, and restore older revisions when needed. Outdated or unnecessary revisions can be deleted safely, keeping your database clean and audit-friendly. This ensures reviewers and administrators always have clear visibility into content history, making compliance and content governance effortless.
✅ Why WP Smart Content?
By combining flexible scheduling, precise hook targeting, role-based permissions, and revisioning, WP Smart Content ensures snippets are placed exactly where and when you want them — and managed safely by the right people. It’s a compliance-ready, SEO-friendly solution that keeps your WordPress site secure, scalable, and easy to maintain.
✨ Key Features
- Classic Hooks support: Add content to wp_head, wp_footer, wp_print_styles, wp_print_scripts, wp_meta, and wp_print_footer_scripts.
- Block Hooks support (WordPress 6.8+): Inject content anywhere in the theme using the block editor UI.
- Grouped dropdowns: Clear separation between Classic Hooks and Block Hooks in the admin interface.
- Global targeting: Apply blocks to all content types, not just posts or pages.
- Scheduling support: Define start and end dates so snippets appear only when needed.
- Safe/Raw Mode toggle: Admins can enable Raw Mode for advanced HTML/JS injection or restrict to Safe Mode for safety.
- Role-based access: Grant trusted non-admins Safe Mode editing rights via the «wpsc_admin» capability.
- Revisioning support: Retrieve, navigate, and restore saved editor revisions, with the ability to delete outdated revisions.
- Translation ready: Includes updated .pot file with all strings for localization.
- Reviewer-friendly architecture: Modularized code, clear documentation, and compliance with WordPress coding standards.
💡 Use Cases
- Add a script to the <head> section without editing theme files.
- Insert HTML into the <footer> for custom notices or widgets.
- Push CSS before WordPress outputs styles for precise control.
- Inject a notice after post content using Block Hooks.
- Manage analytics or marketing tags centrally, without touching templates.
- Schedule snippets to run only during campaigns or seasonal events.
- Delegate Safe Mode CSS editing to a designer or contributor without exposing Raw Mode or sensitive site access.
🔗 Few Supported Hooks
Classic Hooks
- wp_head – Injects content into the «<head>» section before closing tag
- wp_footer – Injects content into the «<body>» section before closing tag
- wp_print_styles – Injects content before WordPress outputs enqueued styles
- wp_print_scripts – Injects content before WordPress outputs enqueued scripts
- wp_meta – Injects content into the meta section of the sidebar
- wp_print_footer_scripts – Injects content before WordPress outputs footer scripts
Block Hooks (WordPress 6.8+)
- after_post_content – Injects content immediately after the post content block
- before_post_content – Injects content immediately before the post content block
- after_comments – Injects content after the comments block
- before_comments – Injects content before the comments block
- after_entry_title – Injects content after the entry/post title block
- before_entry_title – Injects content before the entry/post title block
Optional Context Hooks
- admin_head – Injects content into the «<head>» section of admin pages
- admin_footer – Injects content into the «<footer>» section of admin pages
- login_head – Injects content into the «<head>» section of the login page
- login_footer – Injects content into the «<footer>» section of the login page
- enqueue_block_assets – Injects content when block editor assets are loaded
Usage
Administrators have access to both Raw and Safe modes. Trusted non-administrators can be granted access to pre-created blocks in Safe mode by assigning the «wpsc_admin» capability to their role, either through a role editor plugin or via custom code.
Creating Blocks in WordPress Admin (From the plugin dashboard)
- Install and activate WP Smart Content from the WordPress Plugins screen.
- Go to WP Smart Content Add New Block in the admin menu.
- Enter a block name and paste your HTML, CSS, JavaScript, or tracking code.
- Choose where to inject the block:
- Header (wp_head) for scripts or tracking code
- Footer (wp_footer) for notices or widgets
- Before/after post content for banners or messages
- Block Hooks (WordPress 6.8+) for precise placement in the block editor
- Other classic hooks such as wp_print_scripts or wp_meta
- Select targeting options:
- Apply globally across the site
- Restrict to specific posts, pages, or custom post types
- Set priority to control execution order when multiple blocks use the same hook.
- Define scheduling by assigning start and end dates so snippets appear only when needed.
- Save the block. Your content will be automatically injected at the chosen location.
- Use the Safe/Raw Mode toggle:
- Safe Mode: Restricts advanced HTML/JS in blocks for security
- Raw Mode: Allows full HTML/JS in blocks for trusted admins
- Manage all blocks from the central dashboard. You can edit, enable/disable, publish/unpublish, or delete blocks anytime.
Using the Block Editor to Insert Blocks (Placing directly into templates)
- Once WP Smart Content is activated, open the Site Editor (Appearance Editor) for your block theme.
- Locate Block Hook areas (header, footer, before/after post content, sidebar).
- From the block inserter (+), add the «WP Smart Content» block or select an existing block to edit its injection hook.
- Use WP Smart Content settings in the right sidebar (Block tab) to select an injection hook. This links your stored block snippet to the chosen hook.
- Save the template. Your snippet will be injected automatically at the chosen location.
- Result: Scripts, styles, or HTML are added via the Block UI without editing theme files, fully compatible with block themes.
Using Shortcodes to Insert Blocks (Place inline within posts, pages, or widgets)
- Place the shortcode directly in your post, page, or widget:
[wp_smart_content name="blockname"] - Replace «blockname» with the name of your Smart Content block.
- The shortcode will:
- Inject the block inline at the exact position where the shortcode is placed.
- Respect publish status (only published blocks are shown).
- Respect scheduling (start/end dates defined in block).
- Example:
[wp_smart_content name=»header-banner»]
This will display the “Header Banner” block inline inside your post/page content. - Please note:
- Preferred Injection Point: When configuring the block, it is recommended to select «Placeholder for shortcode» as the injection point. This ensures the block does not render against any other hook.
- Independence from Target Post/Pages: Shortcode injection is not dependent on the Target Post/Pages multiselect. The block will display wherever the shortcode is placed, regardless of targeting settings.
Skjermbilete

Administration screen – Block List (shows all reusable blocks with pagination) 
Administration screen – Block Form (create/edit block with Revisioning, and Safe/Raw toggle) 
Administration screen – Grouped injection points dropdown (Classic vs Block Hooks clearly separated) 
Administration screen – Block Editor (tabs: HTML, CSS, JS, Preview, and Errors) 
Administration screen – Block Form with Injection Point, Target, Priority, and Schedule 
Classic Hooks Reference 
Block Hooks Reference (WordPress 6.8+) 
Optional Context Hooks Reference 
Injecting content anywhere on the theme from blocks UI – Placement 
Injecting content anywhere on the theme from blocks UI – Injection Point
Installasjon
- Upload «wp-smart-content» to the «/wp-content/plugins/» directory.
- Activate the plugin through the Plugins menu in WordPress.
- A new top-level menu called WP Smart Content appears in the WordPress admin sidebar.
Vanlege spm.
-
Why doesn’t my header script show up?
-
The template may not support the chosen hook. Don’t worry — it won’t break your site.
-
My site broke after installation!
-
Unpublish or delete the content pushed through the plugin. Ensure the content added is valid HTML, CSS, or JavaScript.
-
I still have plugin conflicts or the site looks messy.
-
Try selectively disabling other plugins to identify conflicts.
-
How do I uninstall the plugin?
-
Just uninstall it. No residual data or issues will remain.
More questions? Email business[at]vinodsebastian.com — I’ll try to respond promptly.
Omtalar
There are no reviews for this plugin.
Bidragsytarar og utviklarar
“WP Smart Content” is open source software. The following people have contributed to this plugin.
ContributorsOmset “WP Smart Content” til ditt eige språk.
Interested in development?
Les kjeldekoden, sjekk SVN-lageret eller abonner på utviklingsloggen med RSS.
Endringslogg
1.0.0
- Initial launch.
1.0.1
- Fixed AJAX content deletion bug caused by jQuery.
1.1.0
- Revamped code.
- Improved user experience.
- Added ability to update content.
- Fixed frontend display bug.
- Small enhancements.
1.1.1
- Fixed CSS side effects.
1.1.2
- Fixed minor bugs.
1.1.3
- Fixed major bug.
1.1.4
- Enhancements.
1.2.0
- Major restructuring and modularization of files for cleaner architecture and easier maintenance.
- Updated admin UI to align with WordPress theme.
- Added translation readiness.
- Extended support for WordPress 6.8 Block Hooks API and additional injection points.
- Introduced Raw Mode toggle (admins only) with Safe Mode fallback for non-admins.
- Improved pagination controls for block lists.
1.2.1
- Fixed major bug with block hooks API display.
1.2.2
- Fixed major bug with block hooks API display.
- Added more Injection points.
- Added ability to inject content anywhere on the theme from blocks UI.
1.2.3
- Corrected typos and improved readability
- Enhanced user interface for better usability
1.2.4
- Added new capability «wpsc_admin» for finer access control.
- Minor updates and improvements.
1.2.5
- Improved cleanup on uninstall (removes custom capability from Administrator role).
1.2.6
- Enhanced admin UI with accessibility improvements.
- Strengthened error handling for insert/update actions — admins now see proper notices if saving fails.
- Added Priority support using native «menu_order» (default 0). Blocks at the same injection point are injected in ascending order of priority.
- Introduced Content Type badges (TEXT, HTML, JS, CSS) in the list table for instant visibility of block composition.
- General security and compliance refinements.
1.2.7
- Added scheduling facility with start/end date controls for blocks.
- Introduced visual badges in the dashboard to indicate block states (active, scheduled, expired).
- Improved upgrade routines to backfill scheduling and priority metadata for existing blocks.
- Minor code cleanup and translation updates.
1.2.8
Resolved bug in frontend display.
1.2.9
Minor UI refinements.
1.2.10
Added shortcode [wp_smart_content name=»blockname»] for inline block injection based on schedules.
1.2.11
Improvements to list view.
Minor correction to block duplication code.
1.2.12
Minor UI refinements.
Minor bug corrections.
1.2.13
Confirmed compatibility with WordPress 6.9
1.2.14
- Corrected TinyMCE content issues while switching between Visual/Text tabs for consistent behavior using Babel and PostCSS.
1.2.15
- Fixed TinyMCE content issues when switching Visual/Text tabs.
- Removed PostCSS dependency for simpler cleanup.
- Added delete confirmations and clearer save/unpublish messages.
- Improved overall UX consistency.
1.3.0
- Added ability to retrieve old saved revisions of editor content inside a Block.
- Introduced option to delete outdated editor revisions of a block.
- Fixed TinyMCE content issues when switching between Visual and Text tabs.
- Improved overall UX consistency across revision management and editor workflows.
1.3.1
- Added missing files.
1.3.2
- Updated language file.
1.3.3
- Switched editor from TinyMCE to CodeMirror for a modern, developer-friendly snippet editing experience.
- Introduced custom Preview and Error tabs, enabling validation and runtime feedback.