Linux 软件免费装
Banner图

Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts

开发者 WillBontrager
webcraftic
creativemotion
alexkovalevv
themeisle
更新时间 2026年1月27日 23:40
PHP版本: 7.0 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

snippet insert php custom code code snippets header footer scripts

下载

2.7.0 2.2.9 2.3.1 2.3.10 2.7.1 2.4.10 2.4.4 2.4.8 2.6.1 2.2.4 2.4.9 2.2.7 2.4.5 2.4.6 2.6.0 2.0.6 2.4.7 2.7.2 1.3 2.0.4 2.1.91 2.4.2

详情介绍:

Woody Code Snippets is a WordPress plugin that helps you insert code into your site without editing theme files. Many WordPress users still add PHP, JavaScript, CSS, tracking pixels, or ad scripts directly into functions.php, header.php, or footer.php. This approach breaks easily when themes update and becomes hard to manage as your site grows. Woody solves this by giving you a centralized code snippet manager where you can safely add header scripts, footer scripts, PHP snippets, custom CSS, JavaScript, and HTML from the WordPress admin. You can use Woody as a header and footer code manager, a PHP snippet plugin, or a way to reuse content and scripts across your site using shortcodes or automatic insertion. Each snippet can be enabled or disabled instantly, placed in specific locations like before content or after paragraphs, and shown only when certain conditions are met. Quick Links 📘 Documentation – Complete setup and configuration guide 💬 Support Forum – Community help and expert support ⭐ Go Pro – Unlock advanced features and priority support What Problems Does Woody Solve? Woody is built for real WordPress workflows. It helps you: Whether you are building client sites, running marketing experiments, or maintaining your own project, Woody gives you control without unnecessary complexity. How It Works Woody lets you create code snippets and control where and when they run, all from the WordPress admin. Example #1 Create a JavaScript snippet and add your analytics or tracking code.\ Place it in the site header and add a condition to exclude administrators so your own visits are not tracked. Example #2 Create a text snippet with reusable content or a shortcode.\ Add conditions to show it only to logged-in users, then insert it anywhere using the snippet shortcode or automatic placement rules. This makes it easy to manage repeated logic and content without editing theme files. Who Should Use Woody Code Snippets Woody is designed for: If you regularly need to insert code into WordPress, Woody fits naturally into your workflow. Supported Snippet Types Woody supports multiple snippet types, so you can manage all custom code in one place. You can create: Why do you need this plugin? Header and Footer Code Management Woody works as a full header and footer code manager. You can insert snippets: Advanced Placement Options Beyond headers and footers, Woody lets you insert snippets into specific locations. You can place code: WooCommerce Pages Woody supports automatic snippet placement on WooCommerce pages. You can insert snippets: Common use cases include conversion tracking, promotional banners, custom JavaScript, and trust notices. Shortcodes and Reusable Content Woody supports shortcodes so you can insert snippets exactly where you need them. You can place snippets inside posts, pages, widgets, and page builders. With Pro, you can define custom shortcode names that are readable and portable across sites. Conditional Logic for Code Snippets Woody allows you to control when a snippet is displayed. [FREE] Available in the free version: Unlock advanced conditions with Woody Pro. Snippet Management and Organization Woody includes features to keep snippets organized and easy to manage. You can: Code Revisions and Rollback [PRO] With Pro, Woody automatically saves snippet revisions. You can view previous versions, compare changes, and restore earlier revisions if something goes wrong. This adds an extra layer of safety when working with custom code. Cloud Templates and Sync [PRO] Woody Pro includes cloud-based snippet templates. You can save snippets as templates and reuse them across multiple sites, which is especially useful for agencies and developers managing repeated setups. Settings and Developer Options Woody includes advanced settings for fine-grained control. You can: Code Editor The built-in editor includes: Use This Plugin Responsibly Woody allows you to run custom PHP, JavaScript, and CSS on your site. Always make sure you understand the code you add. Using unverified or outdated scripts may affect site security or stability. On multisite installations, only trusted administrators should have access to snippet creation. Woody includes safeguards such as snippet disabling, revisions, and error notifications, but it cannot validate third-party code you choose to run. Support Need help? Open a new thread in the WordPress support forum, and we will be happy to assist. Documentation Learn how to make the most of Woody with our detailed and user-friendly documentation. Woody is backed by Themeisle, trusted by over 1 million WordPress users worldwide.

安装:

  1. Upload the plugin files to the /wp-content/plugins/plugin-name directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Use the PHP Snippets -> Add snippet, to create a new snippet

屏幕截图:

  • Set conditions to control when snippets load
  • Choose the exact location where the code runs
  • Catch code errors before they affect your site
  • Insert snippets directly inside the editor
  • Compare changes and restore previous versions
  • Use custom shortcode names for reusing snippets

常见问题:

How to pass attributes to a snippet using a shortcode?

Add a new attribute “simple” to the shortcode [wbcr_php_snippet id=”xx” simple=”example”]. The attribute “simple” is available in the snippet as the $simple variable. The attribute name can contain Latin letters and lowercase digits. You can also use underscore.

The snippet code executed with an error and I cannot change it, what should I do?

Don’t worry. Mistakes can happen, even with experienced users. Woody includes a Safe Mode that temporarily disables snippet execution so you can fix the issue.

  1. Go to the safe mode by this link: http://your-site-name.dev/wp-admin/?wbcr-php-snippets-safe-mode
  2. Edit the snippet in which you made a mistake;
  3. Leave safe mode by clicking the link: http://your-site-name.dev/wp-admin/?wbcr-php-snippets-disable-safe-mode
Great, now you should not have any issues!

How to pass page content to a snippet?

Pretty often we’d like to hide a part of a text or a form on particular pages and set up display conditions. You need to wrap the content you’d like to pass to a snippet with shortcodes [wbcr_php_snippet id=”xx” simple=”example”]page content[/wbcr_php_snippet]. Page content in a snippet is located in the $content variable.

Does plugin support Gutenberg editor?

Yes, it does. You can add there special blocks from our plugin.

I used the old plugin Insert php 1.3.0. What should I expect in 2.x.x version?

The old version of Insert php 1.3.0 worked this way: you wrapped PHP code with shortcodes [insert_php]php code[/insert_php]. Starting from version 2.x.x and higher, you need to create special snippets to place PHP code. Use a snippet shortcode [wbcr_php_snippetid=”xx”] instead of shortcodes [insert_php][/insert_php] to execute PHP code on pages. We recommend you to move all your code from the post editor to snippets. Important! TinyMCE converts double quotes to special characters. So if you place this code on the snippet editor, it may not work. To avoid this problem, replace all special symbols of double quotes in your PHP code with classic double quotes.

Is there any plugin documentation?

You can find the detailed documentation in here.

Is plugin compatible with GDPR?

Yes, the plugin is fully compatible with GDPR.

Can the plugin be completely uninstalled?

Go to the settings page and enable the "Complete uninstall" option. Than, when you delete Woody Code Snippets using the ‘Plugins’ menu in WordPress it will clean up the database table and a few other bits of data. Be careful not to remove Woody Code Snippets by deleting it from the Plugins menu unless you want this to happen.

How to remove plugin via ftp client?

You have to delete the folder with the plugin, which is located here: wp-content/plugins/insert-php This will not clear the plugin data from the database. You have to remove the plugin through the admin panel with the "Full Uninstall" option enabled in order to completely clear the plugin data.

Will I lose my snippets if I change the theme or upgrade WordPress?

No, the snippets are stored in the WordPress database and are independent of the theme and unaffected by WordPress upgrades.

Does plugin work with multisite?

The plugin doesn’t support multi-sites setup.

更新日志:

Version 2.7.2 (2026-01-27) Version 2.7.1 (2026-01-21) Version 2.7.0 (2026-01-19) New Features Enhancements Bug Fixes Version 2.6.1 (2025-10-21) Version 2.6.0 (2025-10-20) Woody Snippets plugin has been acquired by Themeisle 🎉 We’re happy to announce that Themeisle is now the new owner of Woody Snippets. This acquisition will help ensure the plugin’s continued development, better support, and exciting new updates in the future. Your existing setup will continue to work as usual — no action is required on your part. 2.5.1 2.5.0 2.4.10 2.4.9 2.4.8 2.4.7 2.4.6 (31.05.2022) 2.4.4 (23.03.2022) 2.4.4 (23.03.2022) 2.4.3 2.4.2 2.4.1 2.4.0 2.3.10 2.3.9 2.3.8 2.3.7 2.3.6 2.3.5 2.3.2 2.3.1 (26.11.2019) 2.3.0 (19.11.2019) 2.2.9 (16.09.2019) 2.2.8 (13.09.2019) 2.2.7 2.2.6 2.2.5 2.2.4 2.2.2 2.2.1 2.1.91 2.1.9 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.0.6 2.0.4 2.0.2 Fixed a bug where you do not have enough permissions to view the page. 2.0.1 Attention! This new 2.0 plugin version, we added the ability to insert php code using snippets. This is a more convenient and secure way than using shortcodes [insert_php] code execute [/ insert_php]. However, for compatibility reasons, we left support for [insert_php] shortcodes, but we will depreciate them in the next versions of the plugin. We strongly recommend you to transfer your php code to snippets and call them in your posts/pages and widgets using [wbcr_php_snippet id = "000"] shortcodes. 1.3 Fixed issue with str_replace() when haystack contained a slash character. 1.2 Changed handling of content. 1.1 Bug fix. Added ob_end_flush(); and changed variable names to remove opportunity for conflict with user-provided PHP code. 1.0 First public distribution version.