WPCode (formerly known as Insert Headers and Footers by WPBeginner) is the most popular code snippets plugin for WordPress used by over 2 million websites.
We make it easy for you to add code snippets in WordPress without having to edit your theme’s functions.php file.
Our simple insert headers and footers interface allows you to insert code like Google Analytics, custom CSS, Facebook Pixel, and more to your WordPress site’s header and footer as well other areas of your website. No need to edit your theme files!
Aside from Header and Footer scripts, you can also use WPCode to insert custom PHP code snippets, JavaScript code snippets, CSS code snipets, HTML code snippets, and text snippets with full conditional logic and code priority support.
We took the pain out of adding custom code snippets in WordPress and made it easy.
Features
- Quick to set up
- Unlimited code snippets
- Simple to insert header and footer scripts globally
- Beginner Friendly Code Editor with Syntax Highlighter for PHP, JavaScript, and HTML
- Smart Code Validation to Prevent PHP Errors
- Insert header code and/or footer code using Conditional Logic
- Add Google Analytics code to header and footer
- Add custom CSS code to any theme
- Insert Facebook pixel code in header and footer
- Insert any code or script, including HTML and Javascript
- Insert PHP Code Snippets
- Ready-made Code Snippet Library
- Custom WordPress Code Snippet Generator
- Show or Hide PHP Code Snippets based on conditional logic
- Run PHP code and custom code snippets everywhere or in select areas using smart auto-insert rules.
- Manually insert PHP code snippets using shortcodes anywhere on website
- Add Rich Text Ads and Content Snippets automatically on posts & pages.
- Export / Import Code Snippets
- New Save snippets to Cloud Library – no more wasting time finding Github gists or custom notes. All your snippets stored in your private code snippet cloud.
- New Deep integrations with Gutenberg, WooCommerce, and more.
- Device specific code snippets (such as load code snippets on mobile only, desktop only, etc)
- and more features coming soon.
Changelog
2.1.2
- Tweak: We adjusted the way snippets are tracked in the Admin Bar Code Spotter to avoid wrong numbers in certain locations.
- Tweak: We improved the way the Admin Bar Code Spotter menu is loaded for better compatibility with other plugins and older themes.
- Tweak: Changed the way assets used by the admin bar are loaded to avoid errors if the head is loaded multiple times.
2.1.1
- New: Easily duplicate a snippet with all of its settings with the new Duplicate link in the list of snippets.
- Fix: Taxonomy page conditional logic was not being correctly assigned for category and tags archives.
- Tweak: Adjust admin bar markup to avoid using a heading.
2.1.0
- New: See exactly which scripts and snippets are loaded on the current page with the WPCode admin bar info menu.
- Tweak: Minor update to connect process.
2.0.13.1
- Fix: Improve compatibility with older WordPress versions before version 4.7.
- Fix: Add escaping to tag filter links in the list of snippets.
2.0.13
- New: We have added user customization options for the list of snippets in the admin. Now, you can choose snippet list columns, determine the number of snippets to display, and set the default order of the snippets.
- New: When you save a snippet, the WPCode editor will retain the cursor position, making it easier for you to continue editing larger snippets.
2.0.12
- New: You can now add shortcode attributes and use them in snippets. Any attribute you define becomes available as a variable in PHP & Universal code snippets.
- Tweak: We improved the way the editor is loaded when users enable the “Disable syntax highlighting when editing code” in their profile.
- Tweak: We adjusted the way the editor gets refreshed when changing a snippet code type.
- Fix: The Auto-Insert location was getting reset with every code type change.