Title: Shortcoder — 為想的到的全部項目建立短代碼
Author: vaakash
Published: <strong>2010 年 5 月 8 日</strong>
Last modified: 2026 年 3 月 1 日

---

搜尋外掛

![](https://ps.w.org/shortcoder/assets/banner-772x250.png?rev=2222236)

![](https://ps.w.org/shortcoder/assets/icon.svg?rev=2222236)

# Shortcoder — 為想的到的全部項目建立短代碼

 由 [vaakash](https://profiles.wordpress.org/vaakash/) 開發

[下載](https://downloads.wordpress.org/plugin/shortcoder.6.5.2.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/shortcoder/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/shortcoder/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/shortcoder/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/shortcoder/#developers)

 [技術支援](https://wordpress.org/support/plugin/shortcoder/)

## 外掛說明

Shortcoder 讓網站管理員能為 HTML、JavaScript、CSS 及其他程式碼片段建立自訂短代碼。
短代碼可用於文章及頁面中，並在插入位置執行對應的程式碼片段。

### ✍ 輕鬆建立短代碼

 1. Give a name for the shortcode
 2. Paste the HTML/JavaScript/CSS as shortcode content
 3. Save !
 4. Now insert the shortcode `[sc name="my_shortcode"]` in your post/page.
 5. **Voila !** You got the HTML/Javascript/CSS in your post.

### ✨ 主要功能

 * Create **custom shortcodes** easily and use them in any place where shortcode
   is supported.
 * Have any **HTML**, **Javascript**, **CSS** as Shortcode content.
 * Insert: **Custom parameters** in shortcode
 * Insert: **WordPress parameters** in shortcode
 * Multiple editors: Code, Visual and text modes.
 * Globally disable the shortcode when not needed.
 * Disable shortcode on desktop, mobile devices.
 * A button in post editor to pick the shortcodes to insert.
 * Execute blocks HTML in shortcode content.
 * Insert shortcodes in Gutenberg/block editor.

### 🎲 使用方式範例

 1. Create a shortcode named “adsenseAd” in the Shortcoder admin page.
 2. Paste the adsense code in the box given and save it.
 3. Use `[sc name="adsenseAd"]` in your posts and pages.
 4. Tada !!! the ad code is replaced and it appears in the post.
 5. Now you can edit the ad code at one place and the code is updated in all the locations
    where the shortcode is used.

Similarly shortcodes can be created for frequently used snippets.

You can also add [custom parameters](https://www.aakashweb.com/docs/shortcoder/)(
like `%%id%%`) inside the snippets, and change it’s value like `[sc name="youtube"
id="GrlRADfvjII"]` when using them.

### 🧱 在區塊編輯器中使用

Though shortcodes can be used in **any** place manually, Shortcoder provides below
options to select and insert the shortcodes created easily when working with the
block editor.

 * Shortcoder block
 * Toolbar button to select and insert shortcodes inline (under “more”)

### 💎 升級至 Pro 版

Shortcoder also provides a [PRO version](https://www.aakashweb.com/wordpress-plugins/shortcoder/)
which has additional features to further enhance the experience. Below features 
are offered in the PRO version.

 * **Custom editor** – Edit Shortcode content using block editor or page builder
   plugins like Elementor and WPBakery.
 * **(New) Translation with WPML** – Translate Shortcode content with WPML.
 * **Revisions** – Revisions support for Shortcode content.
 * **Locate shortcode** – Search posts and pages where a shortcode is used.
 * **Extra code** – Include extra code to the footer when a shortcode is used in
   a page.

[Get started with Shortcoder – PRO](https://www.aakashweb.com/wordpress-plugins/shortcoder/)

### 相關連結

 * [線上說明](https://www.aakashweb.com/docs/shortcoder/)
 * [常見問題集](https://www.aakashweb.com/docs/shortcoder/faq/)
 * [技術支援論壇/回報程式碼錯誤](https://www.aakashweb.com/forum/)
 * [Pro 版功能](https://www.aakashweb.com/wordpress-plugins/shortcoder/#pro)

## 螢幕擷圖

 * [[
 * Shortcoder admin page.
 * [[
 * Editing a shortcode.
 * [[
 * “Insert shortcode” popup to select and insert shortcodes.
 * [[
 * A shortcode inserted into post.
 * [[
 * Shortcoder block for Gutenberg editor.
 * [[
 * Shortcoder executed in the post.
 * [[
 * Insert shortcode inline from block editor toolbar.

## 適用於區塊編輯器

這個外掛提供 1 個可供 Gutenberg/區塊編輯器使用的區塊。

 *   Shortcoder

## 安裝方式

 1. Extract the zipped file and upload the folder `Shortcoder` to to `/wp-content/plugins/`
    directory.
 2. Activate the plugin through the `Plugins` menu in WordPress.
 3. Open the admin page from the “Shortcoder” link in the navigation menu.

## 常見問題集

Please visit the [plugin documentation page](https://www.aakashweb.com/docs/shortcoder/)
for complete list of FAQs.

### What are the allowed characters for shortcode name?

Allowed characters are alphabets, numbers, hyphens and underscores.

### My shortcode is not working in my page builder!

Please check with your page builder plugin to confirm if the block/place/area where
the shortcode is being used can execute shortcodes. If yes, then shortcode should
work fine just like regular WordPress shortcodes.

### My shortcode is not working!

Please check the following if you notice that the shortcode content is not printed
or when the output is not as expected.

 * Please verify if the shortcode content is printed. If shortcode content is not
   seen printed, check the shortcode settings to see if any option is enabled to
   restrict where and when shortcode is printed. Also confirm if the shortcode name
   is correct and there is no duplicate `name` attribute for the shortcode.
 * If shortcode is printed but the output is not as expected, please try the shortcode
   content in an isolated environment and confirm if the shortcode content is working
   correctly as expected. Sometimes it might be external factors like theme, other
   plugin might conflict with the shortcode content being used.
 * There is a known limitation in shortcodes API when there is a combination of 
   unclosed and closed shortcodes. Please refer [this document](https://codex.wordpress.org/Shortcode_API#Unclosed_Shortcodes)
   for more information.

### Can I insert PHP code in shortcode content?

No, right now the plugin supports only HTML, Javascript and CSS as shortcode content.

### Can I use block editor or page builders like Elementor, WPBakery to create shortcode?

Yes, this feature is available in the PRO version. You can upgrade to the [PRO version](https://www.aakashweb.com/wordpress-plugins/shortcoder/)
to design using custom editor and create shortcode for that.

## 使用者評論

![](https://secure.gravatar.com/avatar/cfe305ce0855d92791f9cb4c737fce2b5f7b59f2ea8f37c22ecae096cf634da9?
s=60&d=retro&r=g)

### 󠀁[Great Replacement for Reusable Text Blocks Plugin](https://wordpress.org/support/topic/great-replacement-for-reusable-text-blocks-plugin/)󠁿

 [mattsson](https://profiles.wordpress.org/mattsson/) 2026 年 4 月 2 日

Thank you for creating this plugin. I needed a replacement for the excellent but
long defunct Reusable Text Blocks plugin by Hal Gatewood. Because for one website
there were a couple of sentences I needed to repeat in a few dozen places, and for
the other website I created a custom two-column layout and used Shortcoder to place
blocks of content within the columns. I appreciate you recently adding the context-
sensitive color coding to the HTML editor. I’d like it if I didn’t need to fill 
in the HTML paragraph tags for HTML content, which is different than content I type
in to the WordPress Classic editor.

![](https://secure.gravatar.com/avatar/659d12270c5317f19c3d7248cd817f51b0d0de661d73bc3f4a131245f0a0351b?
s=60&d=retro&r=g)

### 󠀁[good!](https://wordpress.org/support/topic/good-9098/)󠁿

 [luter_88](https://profiles.wordpress.org/luter_88/) 2026 年 2 月 24 日 2 則留言

Finally, a plugin like this has appeared in the catalog!

![](https://secure.gravatar.com/avatar/cc2a9cd5e4097876802a40afc3f0865a84fa3c9d2c2caa6c789218fe9ae52b2f?
s=60&d=retro&r=g)

### 󠀁[Essential Tool for Custom Code Snippets](https://wordpress.org/support/topic/essential-tool-for-custom-code-snippets/)󠁿

 [TraceMyIP](https://profiles.wordpress.org/tracemyip/) 2025 年 6 月 9 日 1 則留言

Shortcoder is a game-changer for anyone who needs to reuse HTML, CSS, or JavaScript
across their site! Creating shortcodes is ridiculously simple – just name it, paste
your code, and you’re done. Love how it works seamlessly with both classic and Gutenberg
editors. The ability to disable shortcodes globally or on specific devices is brilliant
for testing. Custom parameters make it super flexible too. Whether you’re embedding
complex widgets or simple HTML blocks, this plugin saves tons of time. Clean interface,
reliable performance – exactly what you need for code management!

![](https://secure.gravatar.com/avatar/3f7870176d55d02a15ee6fb7ea95699d5f7e2c9e608351952b4ff227cac87fc2?
s=60&d=retro&r=g)

### 󠀁[إضافة جبارة أنصح بها وبشدة للأمانة](https://wordpress.org/support/topic/%d8%a5%d8%b6%d8%a7%d9%81%d8%a9-%d8%ac%d8%a8%d8%a7%d8%b1%d8%a9-%d8%a3%d9%86%d8%b5%d8%ad-%d8%a8%d9%87%d8%a7-%d9%88%d8%a8%d8%b4%d8%af%d8%a9-%d9%84%d9%84%d8%a3%d9%85%d8%a7%d9%86%d8%a9/)󠁿

 [proarab](https://profiles.wordpress.org/proarab/) 2025 年 5 月 24 日 1 則留言

تستطيع من خلالها تنظيم الأكواد الخاصة بك وتعديلهن وتحريرهن بكل سهولة أنصح بها وبشدة

![](https://secure.gravatar.com/avatar/406f6c121a65d727acf8851a392ee76a36eab80d952232042a27360eca6b6d09?
s=60&d=retro&r=g)

### 󠀁[Simple, Perfect](https://wordpress.org/support/topic/simple-perfect-92/)󠁿

 [semperaye](https://profiles.wordpress.org/semperaye/) 2025 年 3 月 16 日 1 則留言

This plugin is epic and should be part of WP natively :)Shortcodes can easily be
found and edited from the dashboard. No issues on latest version of WP.

![](https://secure.gravatar.com/avatar/0fbccc4849f0a7ea730f30f343b29f79d83ba8ea927808dd450110626470b08c?
s=60&d=retro&r=g)

### 󠀁[Great, easy to setup.](https://wordpress.org/support/topic/great-easy-to-setup-2/)󠁿

 [1000zen](https://profiles.wordpress.org/1000zen/) 2025 年 3 月 9 日 1 則留言

Great to add featured image on any place in the post

 [ 閱讀全部 226 則使用者評論 ](https://wordpress.org/support/plugin/shortcoder/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Shortcoder — 為想的到的全部項目建立短代碼〉的開發相關工作。

參與者

 *   [ vaakash ](https://profiles.wordpress.org/vaakash/)

〈Shortcoder — 為想的到的全部項目建立短代碼〉外掛目前已有 14 個本地化語言版本。 
感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/shortcoder/contributors)
為這個外掛做出的貢獻。

[將〈Shortcoder — 為想的到的全部項目建立短代碼〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/shortcoder)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/shortcoder/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/shortcoder/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/shortcoder/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/shortcoder/)。

## 變更記錄

### 6.5.2

 * Fix: Sanitize custom field value before being inserted into post.

### 6.5.1

 * Fix: Added `null` checks to fix warning in some scenarios.

### 6.5

 * Fix: Support for WordPress 6.8.

### 6.4

 * New: Option to set shortcode display name next to shortcode name.
 * New: Option to execute WordPress block HTML in shortcode content.
 * Fix: Shortcoder roles are registered when plugin is activated.

### 6.3.2

 * Fix: Verify permissions while closing Shortcoder changelog.

### 6.3.1

 * Fix: Admin ajax vulnerability with nonce.

### 6.3

 * New: Set default value for the custom field parameters.
 * New: Custom parameter default value is shown in the insert shortcode popup.
 * Fix: Restrict access to admin-ajax calls.
 * Fix: Some admin texts were missing translation.
 * Fix: Removed the note in the insert popup for fully closed shortcode.
 * Fix: Debug comment line now has the name of the shortcode.

### 6.2

 * New: Option to show shortcode content in “All shortcodes” page.
 * Fix: Some texts were not translated.
 * Fix: Error in WP Bakery page builder while picking images.

### 6.1

 * New: Enhancements to shortcode edit screen meta boxes.
 * Fix: HTML is escaped in the editor sometimes.
 * Fix: Support for WordPress 6.1

### 6.0

 * New: PRO version is introduced.
 * New: Prevent same shortcode nested loop.
 * New: New actions and filters introduced.
 * Fix: Post excerpt shortcode parameter now prints full post excerpt.
 * Fix: Enhancements to input and output data sanitization.

### 5.8

 * New: Option to set description for the shortcode.
 * New: New actions and filters introduced.
 * Fix: Minor admin UI enhancements.

### 5.7

 * New: Reordered shortcode column in the “All shortcodes” page.
 * New: Option to copy shortcode directly from “All shortcodes” page.
 * New: Filter `sc_mod_content` to modify shortcode content before execution.
 * Fix: Shortcode won’t save if the email field in the feedback form has invalid
   value.
 * Fix: Custom parameter with hyphen was not highlighted in code editor.
 * Fix: Minor admin UI enhancements.

### 5.6

 * New: Shortcodes available to copy/insert are now closed by default.
 * Fix: Custom parameter value 0 is not displayed.
 * Fix: Support for WordPress 5.8

### 5.5

 * New: General settings page to configure default editor and shortcode content.
 * New: Block to insert shortcode rewritten from scratch.
 * New: Toolbar button to insert shortcodes inline.
 * New: Shortcodes are now closed by default when inserted from editor.
 * Fix: Custom fields parsing issue when they are placed next to each other.
 * Fix: Enclosed content in block input now retains multi-line.
 * Fix: Minor refinements to UI.

### 5.4

 * New: Code editor is now loaded locally and not from cloudflare.
 * New: Code editor now shows hints and highlights any syntax error.
 * New: Hyphens can now be used in shortcode custom parameters.
 * Fix: Handle scenario where shortcode attribute is received as a string sometimes.
 * Fix: Notice where `wp_localize_script` was called incorrectly.
 * Fix: Handle scenario where HTML is passed as shortcode parameter.
 * New: WordPress requirement changed from 4.4 to 4.9

### 5.3.4

 * New: Tested with WordPress 5.6
 * Fix: Handle warning with `trim` while fetching page metadata at some pages.

### 5.3.3

 * New: Support for `post slug` as the new shortcode parameter under WordPress information.
 * New: Codemirror has been updated to latest version.
 * Fix: Handle code editor loading issue when there is any collision.
 * Fix: Handle input fields which have empty `id` attribute.
 * Fix: Handle issue of `$post` object being undefined at some cases.
 * Fix: Renamed usages of `__class__` to `__CLASS__`

### 5.3.2

 * New: In code editor, shortcodes will be highlighted and code editor font size
   is slightly bigger.

### 5.3.1

 * New: Code editor is now made the default editor.
 * Fix: Minor changes to admin UI.

### 5.3

 * New: Added support for underscores in custom parameters.
 * New: Getting ready for internationalization of the plugin.
 * Fix: Insert shortcode popup shows duplicate available parameters in case of same
   parameter with different case.

### 5.2.1

 * Fix: Custom parameters being not replaced in some scenarios.
 * Fix: Minor enhancement to insert custom parameter form.

### 5.2

 * New: Default values can now be provided to custom parameters.
 * Fix: Script tags, custom field placeholder and backslash being stripped after
   saving the shortcode sometimes.
 * Fix: Rel attribute being modified for links.
 * New: Added “Manage shortcodes” link to plugin list page for easy access after
   activation.

### 5.1

 * New: Import/Export link added to the shortcoder list page.
 * Fix: `empty()` was throwing error at some places for users using PHP 5.5 below
   as function return value was passed to it.
 * Fix: Shortcoder QTTags button was loading in frontends.
 * Fix: “Insert shortcode” popup was hidden behind in theme customizer page.
 * Fix: `array_key_exists` array but bool given warning.
 * Fix: Hide comments metabox in shortcode edit page as it was shown in certain 
   conditions.

### 5.0.4

 * Fix: `script` and `style` tags stripped after 4.x upgrade. New migration will
   run in this version and shortcode content will now be fixed.

### 5.0.3

 * Fix: Shortcode content is not escaped when code editor is used. This is requirement
   because `post_content` behaves strangely when user has rich editing enabled.

### 5.0.2

 * Fix: Shortcodes inside shortcode content not getting executed.
 * Fix: Disable Gutenberg block for older not supported WordPress versions.

### 5.0.1

 * Fix: Code editor escaping HTML characters.
 * Fix: `get_current_screen()` undefined.
 * Fix: Code editor breaks if there is any other plugin which loads codemirror.
 * Fix: `tools.php` is not found.

### 5.0

 * New: Brand new version. Plugin rewritten from scratch.
 * New: Shortcoder block for the block editor.

### 4.4

 * New: Insert shortcode automatically adds “closing tag” if the shortcode has enclosed
   content parameter.
 * Fix: Codemirror has been updated to latest version.

### 4.3

 * New: Edit shortcode name after creating.
 * New: Post modified date parameter added.
 * Fix: Date parameters now display in site language.

### 4.2

 * Fix: Some plugins fail to fire onload JS event since it was overwritten by shortcoder.
 * Fix: Javascript in insert shortcode popup not working in IE 11.
 * Fix: Missing parenthesis while calling `is_year`.
 * Fix: Widgets page not loading insert shortcode popup.
 * Fix: Removed settings emoji icon from plugin actions list.
 * Fix: Load latest version 5.42.0 of codemirror.
 * Fix: Updated minimum required WordPress version.

### 4.1.9

 * Fix: Minor UI refinements for better experience.
 * Fix: Import error where some exported JSON files have 0 as EOF.

### 4.1.8

 * New: Insert custom fields in shortcode content.
 * Fix: Removed comments in shortcode output

### 4.1.7

 * New: Categorize, search and filter shortcodes using “tags”.
 * New: Last used shortcode editor will be saved along with shortcode.
 * New: Enclosed shortcode content can now be used as shortcode parameter.
 * New: Active line highlight has been enabled for code editor.
 * Fix: Codemirror has been updated to latest version.
 * Fix: Minor admin interface enhancements.

### 4.1.6

 * New: Date variables can noe be added into shortcode content.
 * Fix: Error “trying to get property of non-object” is handled.

### 4.1.5

 * New: Bloginfo variables can now be added into shortcode content.

### 4.1.4

 * New: Codemirror powered syntax highlighted shortcode content code editor (beta).

### 4.1.3

 * Fix: Shortcode names with not-allowed characters cannot be edited/deleted.
 * New: Shortcode imports made can now be fresh or overwritten.
 * New: Only users with `manage_options` capability will see “edit shortcode” option
   in insert window.
 * Fix: Import failure with UTF-8 characters.
 * Fix: Case sensitive search in admin pages.
 * Fix: Minor admin interface changes.

### 4.1.2

 * New: Search box for shortcodes in admin page.

### 4.1.1

 * Fix: HTTP 500 error because of syntax error in import module.

### 4.1

 * New: Import/export feature for shortcodes.
 * Fix: Visual editor is now disabled by default.
 * Fix: Added instructions in admin page.

### 4.0.3

 * New: Added feature to sort created shortcodes list.
 * Fix: HTML errors in admin page

### 4.0.2

 * Fix: Sometimes `get_current_screen()` was called early in some setups.

### 4.0.1

 * Fix: Servers with PHP version < 5.5 were facing HTTP 500 error because of misuse
   of PHP language construct in code.

### 4.0

 * New: Plugin rewritten from scratch.
 * New: Brand new administration page
 * New: Shortcode visibility settings, show/hide in desktop/mobile devices
 * New: Insert WordPress information into shortcode content.
 * Fix: Insert shortcode window is not loading.
 * Fix: Unable to delete the shortcodes

(Older change logs are removed from this list)

## 中繼資料

 *  版本 **6.5.2**
 *  最後更新 **1 個月前**
 *  啟用安裝數 **100,000+**
 *  WordPress 版本需求 ** 4.9.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.9.4**
 *  PHP 版本需求 ** 5.3 或更新版本 **
 *  語言
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/shortcoder/)、[Dutch](https://nl.wordpress.org/plugins/shortcoder/)、
   [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/shortcoder/)、[English (Canada)](https://en-ca.wordpress.org/plugins/shortcoder/)、
   [English (US)](https://wordpress.org/plugins/shortcoder/)、[Italian](https://it.wordpress.org/plugins/shortcoder/)、
   [Japanese](https://ja.wordpress.org/plugins/shortcoder/)、[Korean](https://ko.wordpress.org/plugins/shortcoder/)、
   [Russian](https://ru.wordpress.org/plugins/shortcoder/)、[Spanish (Chile)](https://cl.wordpress.org/plugins/shortcoder/)、
   [Spanish (Colombia)](https://es-co.wordpress.org/plugins/shortcoder/)、[Spanish (Ecuador)](https://es-ec.wordpress.org/plugins/shortcoder/)、
   [Spanish (Mexico)](https://es-mx.wordpress.org/plugins/shortcoder/)、[Spanish (Spain)](https://es.wordpress.org/plugins/shortcoder/)、
   及 [Spanish (Venezuela)](https://ve.wordpress.org/plugins/shortcoder/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/shortcoder)
 * 標籤
 * [code](https://tw.wordpress.org/plugins/tags/code/)[html](https://tw.wordpress.org/plugins/tags/html/)
   [javascript](https://tw.wordpress.org/plugins/tags/javascript/)[shortcode](https://tw.wordpress.org/plugins/tags/shortcode/)
   [snippets](https://tw.wordpress.org/plugins/tags/snippets/)
 *  [進階檢視](https://tw.wordpress.org/plugins/shortcoder/advanced/)

## 評分

 4.9 星，滿分為 5 星

 *  [  210 個 5 星使用者評論     ](https://wordpress.org/support/plugin/shortcoder/reviews/?filter=5)
 *  [  9 個 4 星使用者評論     ](https://wordpress.org/support/plugin/shortcoder/reviews/?filter=4)
 *  [  2 個 3 星使用者評論     ](https://wordpress.org/support/plugin/shortcoder/reviews/?filter=3)
 *  [  1 個 2 星使用者評論     ](https://wordpress.org/support/plugin/shortcoder/reviews/?filter=2)
 *  [  4 個 1 星使用者評論     ](https://wordpress.org/support/plugin/shortcoder/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/shortcoder/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/shortcoder/reviews/)

## 參與者

 *   [ vaakash ](https://profiles.wordpress.org/vaakash/)

## 技術支援

最近 2 個月解決的問題:

     總計 5 個問題，已解決 3 個

 [檢視技術支援論壇](https://wordpress.org/support/plugin/shortcoder/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.me/vaakash/)