前言介紹
- 這款 WordPress 外掛「WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager」是 2012-07-11 上架。
- 目前有 2000000 個安裝啟用數。
- 上一次更新是 2025-04-01,距離現在已有 32 天。
- 外掛最低要求 WordPress 4.6 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.5 以上。
- 有 1562 人給過評分。
- 論壇上目前有 8 個提問,問題解答率 50%
外掛協作開發者
smub | gripgrip | wpbeginner | wpcodeteam |
外掛標籤
css | php | code | header | code-snippets |
內容簡介
插入標頭和頁腳 + 完整的 WordPress 代碼片段外掛
WPCode (前稱为 WPBeginner 的 "插入標頭和頁腳")是使用率超过 100 万个网站的 WordPress 代码片段外掛中最受歡迎的一個。
我們让你可以輕鬆添加 WordPress 代碼片段,而无需編輯主題的 functions.php 文件。
我们简单的標頭和頁腳界面允许您在 WordPress 中插入像 Google Analytics、自定义 CSS、Facebook Pixel 等代码片段,以及您網站其他區域的標頭和頁腳。无需編輯主題文件!
除了標頭和頁腳脚本外,您還可以使用 WPCode 插入自定义 PHP 代码片段、JavaScript 代码片段、CSS 代码片段、HTML 代码片段和文本片段,並支持完整的条件逻辑和代码优先级。
我们让在 WordPress 中添加自定义代码片段变得轻松。
我一直在使用插入標頭和頁腳,它真是一個有用的工具。非常有用,絕不失望。強烈推荐
The_Gibble - WordPress 用户
WPCode 簡介
介绍新 WPCode Pro
虽然 WPCode Lite 免费提供了许多强大功能,但我们聆听用户的反馈,创建了更多令人惊叹的功能以提高您的工作效率 - 智能条件逻辑、保存代码片段到云库、代码修订、页面专用片段、与 WooCommerce、Easy Digital Downloads 等流行插件深度集成等等。 立即购买最好的 WordPress 代码片段外掛!
未来证明的代码片段管理
大多數的WordPress 教程网站要求您将代码片段添加到您的主題 functions.php 文件中。这使得管理代码片段变得混乱,而且还会阻止您更新您的主题。
WPCode 通过提供直接从 WordPress 仪表板插入標頭和頁腳脚本以及其他代码片段的简单方法解决了这个问题。这些代码片段实际上会像它们在主题的 functions.php 文件中一样运行。
我们聰明的代码片段验证功能可以帮助您预防常见的代码错误,确保您添加代码片段或標頭和頁腳脚本时永远不会破坏您的网站。
您可以在单个屏幕上管理所有标头和页脚脚本以及其他自定义代码片段。我们甚至让您可以使用标签组织代码片段并在每个代码片段上添加提醒注释。
新的 WPCode 云库甚至允许您将所有自定义代码片段保存在云库中,以便您可以轻松地在多个网站项目中重复使用代码片段并节省时间。您可以将您的代码片段完全保留私密,或与社群分享以回馈和提高您的社交资料。
这个外掛讓我不再需要在必要的時候添加東西到我的网站,只需要幾秒鐘就能完成
David Weber - WordPress 用户
完整的代码片段库和代码生成器
原文外掛簡介
Insert Headers & Footers + Full WordPress Code Snippets Plugin
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 snippets, HTML code snippets, and text snippets with full conditional logic support.
We took the pain out of adding custom code snippets in WordPress and made it easy.
I have been using Insert Headers and Footers and it is such a useful tool. Super helpful and the very best of its kind. Highly recommend
The_Gibble – WordPress user
Quick Overview of WPCode from WPBeginner
Introducing New WPCode Pro
While WPCode Lite offers tons of powerful features for free, we listened to user feedback and created WPCode Pro with even more amazing features to improve your workflow. This includes smart conditional logic, saving code snippets to cloud library, code revisions, page-specific snippets, deeper integration with popular plugins like WooCommerce, Easy Digital Downloads, and so much more. Click here to purchase the best premium WordPress code snippet plugin now!
Future Proof Code Snippet Management
Most WordPress tutorial websites ask you to add code snippets to your theme’s functions.php file. This makes managing code snippets messy, and it also prevents you from updating your theme.
If you ever update your theme or switch to another theme, then you will lose all custom code functions that you added in your functions.php file.
WPCode solves this by providing you an easy way to insert header and footer scripts along with other code snippets directly from your WordPress dashboard. These code snippets actually run as if they were in your theme’s functions.php file.
Our smart code snippet validation helps you prevent common code errors to ensure you never break your website when adding code snippets or header and footer scripts.
New WPCode Cloud Library even allows you to store all your custom code snippets in a cloud library, so you can easily re-use code snippets across multiple website projects and save time. You can keep your code snippets completely private or share it with the community to give back while boosting your social profile.
This plugin allows me to not only add things to my site whenever needed, but it takes me only seconds to accomplish it.
David Weber – WordPress user
Full Code Snippets Library and Code Generators
Ever wanted a central place to find all the most popular WordPress code snippets that are tested and proven to work?
When we started Insert Headers and Footers plugin, we did too. So we built a WordPress code snippets library right inside the WPCode plugin.
You will find verified PHP code snippets for popular feature requests like disable REST API, disable XML-RPC, disable comments, allow SVG file uploads, disable Gutenberg, add Classic Editor, and more without installing separate plugins for each.
I was very hesitant to get into any of the code for my website. Your plugin made it easy for me to do.
Conbrio75 – WordPress user
We also built the ability to save your code snippets to WPCode Cloud Library, so you can easily re-use it on your other websites, client projects, or even share it with the larger community.
WPCode Cloud Library helps you better organize your code snippets in one central location, so you can save more time and speed up your workflow when managing websites. No more wasting time looking for custom notes or Github gists.
Aside from our growing code snippets library, we also have WordPress code generators to help you quickly get ready-to-use custom code using the latest WordPress coding standards and API’s.
Conditional Logic for Code Snippets + Code Insertion Priority
Our goal with WPCode was to create a WordPress code snippets plugin that’s both EASY and POWERFUL.
That’s why aside from our global header and footer scripts, we added advanced features like conditional logic for code snippets and made it easy.
Instead of learning WordPress conditional logic queries, you can use our beginner-friendly conditional logic user interface to:
Load code snippets for logged in users only
Load PHP code snippets for specific user roles
Load PHP code snippets only on specific page URLs
Insert header and footer pixel scripts on specific pages
Show code snippets based on type of page
Run code snippet only on certain post types
Load header and footer code snippet based on referrer source
and more…
We also added both automatic code insertion and manual code output using shortcodes.
Our Auto Insert feature allows you to run the code snippet everywhere or choose from custom options like:
Run code snippet only on frontend
Run code snippet only in WordPress admin area
Add header and footer scripts sitewide
Insert PHP code snippet before or after post content
Insert code snippet before or after specific paragraph
Insert code snippet on specific archive pages
Insert code snippets after specific WooCommerce function (Pro Feature)
Aside from that, we also added a visual code snippet priority system, so you can choose the order for your custom functions to avoid code conflict.
This is such a useful plugin! It makes it so much easier to include things on your website!
Understoryliving – WordPress user
And for even more flexibility and customization, we have added the ability for you to add page-specific code snippets right from the WordPress classic editor as well as the Gutenberg editor. You can even load code snippets based on device type such as mobile only code snippets, desktop only code snippets, etc.
Import and Export Code Snippets
Managing multiple websites or developing in a staging environment?
We offer an easy way to import and export your custom code snippets, functions, and header and footer scripts to help you save time.
You can also save your code snippets to WPCode Cloud (Pro feature), so you can easily re-use the same code snippets across multiple websites. This also allows you to better organize your code snippets instead of wasting time searching for random Github gists.
Simple plugin I use in quite every site. Very useful to insert scripts and tags.
tommasoperego – WordPress user
Full WPCode Feature List
The simple interface of WPCode plugin (formerly known as Insert Headers and Footers) gives you one place where you can insert header and footer scripts as well as custom code snippets rather than dealing with dozens of different plugins.
Below is a full list of WPCode 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 – 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.
Credits
Insert Headers and Footers plugin was first created by Syed Balkhi and the WPBeginner team in 2011.
It was later rebranded to WPCode in 2022 by Syed Balkhi to add powerful code snippets features that users were requesting for.
Branding Guideline
WPCode™ is a trademark of WPCode LLC. When writing about the Insert Headers and Footers – Code Snippets plugin by WPCode, please make sure to uppercase the initial 3 letters.
WPCode (correct)
WP Code (incorrect)
wpcode (incorrect)
wp code snippets (incorrect)
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1 | 1.2 | 1.3 | 1.4 | 1.3.1 | 1.3.2 | 1.3.3 | 1.4.1 | 1.4.2 | 1.4.3 | 1.4.4 | 1.4.5 | 1.4.6 | 1.5.0 | 1.6.0 | 1.6.1 | 1.6.2 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.0.6 | 2.0.7 | 2.0.8 | 2.0.9 | 2.1.0 | 2.1.1 | 2.1.2 | 2.1.3 | 2.1.4 | 2.1.5 | 2.1.6 | 2.1.7 | 2.1.8 | 2.1.9 | 2.2.0 | 2.2.1 | 2.2.2 | 2.2.3 | 2.2.4 | 2.2.5 | 2.2.6 | 2.2.7 | trunk | 2.0.10 | 2.0.11 | 2.0.12 | 2.0.13 | 2.1.10 | 2.1.11 | 2.1.12 | 2.1.13 | 2.1.14 | 2.0.4.1 | 2.0.4.2 | 2.0.4.3 | 2.0.4.4 | 2.0.8.1 | 2.1.3.1 | 2.1.4.1 | 2.2.3.1 | 2.2.4.1 | 2.0.13.1 |
延伸相關外掛(你可能也想知道)
Code Snippets 》Code Snippets 是在您的網站上運行程式碼片段的簡單,清潔和簡單的方法。它消除了將自定義片段添加到您的佈景主題的 functions.php 檔案的需求。, 現在提供 C...。
Widget CSS Classes 》Widget CSS Classes 可以讓您給 WordPress Widget 添加自定義的 class 和 id, 請注意,此外掛並不支援輸入自定義的 CSS。您需要修改主題的 style.css,或加入...。
Simple Custom CSS Plugin 》無需麻煩地將自訂 CSS 新增到 WordPress 網站中。, 這是一個易於使用的 WordPress 外掛,可以添加自訂 CSS 樣式以覆寫外掛和佈景主題的預設樣式。該外掛旨在...。
Simple CSS 》需要在你的網站中添加自定義 CSS 嗎?Simple CSS 提供一個很棒的管理編輯器和 Customizer 中的即時預覽編輯器,讓你能夠輕鬆添加 CSS。, 想讓你的 CSS 僅應用...。
WP Add Custom CSS 》WP Add Custom CSS 外掛允許您在整個網站及個別文章、頁面和自訂文章類型(例如 Woocommerce 產品)中添加自訂的 CSS。, 對整個網站應用的 CSS 樣式將覆蓋您...。
Visual CSS Style Editor 》Style your WordPress site visually. Discover the most popular front-end design plugin! Try live demo., , Visual CSS Editor, The plugin allows you t...。
WP-SCSS 》此外掛使用 ScssPhp,在 WordPress 安裝中編譯 .scss 檔案。包含設定頁面,可配置目錄、錯誤報告、編譯選項和自動佇列。, 此外掛僅在更改 .scss 檔案時進行編...。
Clear Cache for Me 》Clear Cache For Me 是一個 WordPress 外掛,適用於 W3 Total Cache 和 WP Super Cache,因為它們不知道 widget 何時更新,且在更新 widget 和 menu 時都不會...。
Scripts n Styles 》這個外掛讓管理員用戶能夠將自訂的 CSS 和 JavaScript 直接添加到個別文章、頁面或任何註冊的自訂文章類型中,也可以將類別添加到 body 標籤和文章容器中。還...。
Forget About Shortcode Buttons 》相容於 WordPress 傳統編輯器,Gutenberg 整合即將推出🙂, 歡迎提出功能需求/建議!, 即忘短碼(FASC)按鈕是在所見即所得編輯器中及網站佈景主題中加入 CSS 按...。
Code Embed 》注意: WordPress 5.0 及以上版本的使用者請查看常見問題以了解如何在區塊編輯器中使用此外掛。, Code Embed 外掛允許您在文章中嵌入程式碼(JavaScript 和 H...。
Raw HTML 》is capability is only granted to administrators. If you’re not an admin, you will need to ask them to add it to your role., Raw HTML is not r...。
Microthemer Lite – Visual Editor to Customize CSS 》Microthemer是一個輕量級且功能強大的視覺編輯器,可以自訂網站的CSS樣式,從Google字體到響應式佈局,它適用於程式開發人員和非程式開發人員,並與Elementor...。
Core Framework 》總結:Core Framework是一個簡單易用、樂趣滿滿的WordPress外掛,如同你的CSS瑞士軍刀,幫助你輕鬆打造完美網站。, , 問題與答案:, - Core Framework是什麼...。
WP Super Minify • Minify, Compress and Cache HTML, CSS & JavaScript 》這個外掛可以在需要時結合、縮小和緩存內聯的 JavaScript 和 CSS 文件,以加快頁面加載速度,並使用Minify PHP Framework。, 啟用此外掛後,您會發現您的 HTM...。