Title: SQL To CPT
Author: badasswp
Published: <strong>2024 年 10 月 12 日</strong>
Last modified: 2026 年 4 月 23 日

---

搜尋外掛

![](https://ps.w.org/sql-to-cpt/assets/banner-772x250.png?rev=3167545)

![](https://ps.w.org/sql-to-cpt/assets/icon-256x256.png?rev=3167545)

# SQL To CPT

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

[下載](https://downloads.wordpress.org/plugin/sql-to-cpt.1.4.1.zip)

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

 [技術支援](https://wordpress.org/support/plugin/sql-to-cpt/)

## 外掛說明

This plugin helps you **migrate legacy SQL database tables** to WordPress’ **Custom
Post Types (CPT)**. It provides a **user-friendly UI interface** that enables users
upload an SQL file which is then parsed and converted to a CPT with meta data that
is recognisable within WordPress.

If you ever need to migrate a non-WordPress database table into WP, look no further.
This is exactly what you need!

#### ✔️ Features

Our plugin comes with everything you need to easily migrate SQL tables to CPTs.

✔️ **Import & Convert to CPT** feature.
 ✔️ **Quick & Lightening Fast uploads**.
✔️ **Friendly, User Interface (UI)**. ✔️ **Custom Post Type Capabilities**. ✔️ **
Error Loggging Capabilities**. ✔️ **Custom Hooks** to help you customize plugin 
behaviour. ✔️ Available in **mutiple langauges** such as Arabic, Chinese, Hebrew,
Hindi, Russian, German, Italian, Croatian, Spanish & French languages. ✔️ **Backward
compatible**, works with most WP versions.

#### ✨ Getting Started

Head over to the **SQL to CPT** options page. Upload an SQL file of your choice 
by clicking on the **Import SQL File**. This would analyse your SQL table and show
you the **table name** and **table columns** you are about to import. Once ready,
click on the **Convert to CPT** button to complete the process.

On import completion, you should now be re-directed to the Custom Post Type page
of your newly imported data!

You can get a taste of how this works, by using the [demo](https://tastewp.com/create/NMS/8.0/6.7.0/sql-to-cpt/twentytwentythree?ni=true&origin=wp)
link.

#### ⚡ Why SQL to CPT ?

 1. Because you need something that works great and fast!
 2. Because you want to port your data across platforms easily.
 3. Because you don’t want to spend hours building custom software for this.
 4. Because you think **SQL to CPT** is cool.

NB: At the moment, the **SQL to CPT** plugin currently does not provide a way for
users to import more than one SQL table at a time, this feature should be available
in future releases as well as the option to remove unused CPTs.

#### 🔌🎨 Plug and Play or Customize

The SQL to CPT plugin is built to work right out of the box. Simply install, activate
and start using.

Want to add your personal touch? All of our documentation can be found [here](https://github.com/badasswp/sql-to-cpt).
You can override the plugin’s behaviour with custom logic of your own using [hooks](https://github.com/badasswp/sql-to-cpt?tab=readme-ov-file#hooks).

### Contribute

If you’d like to contribute to the development of this plugin, you can find it on
[GitHub](https://github.com/badasswp/sql-to-cpt).

To build, clone repo and run `yarn install && yarn build`

## 螢幕擷圖

 * [[
 * Import SQL File screen – Upload your SQL File by clicking on the ‘Import SQL 
   File’ button.
 * [[
 * Import Modal – Select the SQL file you intend to import.
 * [[
 * Custom Post Type page – List of uploaded data from SQL file.
 * [[
 * Custom Post Type screen – Imported SQL data showing custom fields in CPT.

## 安裝方式

 1. Go to ‘Plugins > Add New’ on your WordPress admin dashboard.
 2. Search for ‘SQL To CPT’ plugin from the official WordPress plugin repository.
 3. Click ‘Install Now’ and then ‘Activate’.
 4. Head over to the ‘SQL to CPT’ options page.
 5. Upload an SQL file of your choice and convert it to a Custom Post Type (CPT).

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈SQL To CPT〉的開發相關工作。

參與者

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

[將〈SQL To CPT〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/sql-to-cpt)

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

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

## 變更記錄

#### 1.4.1

 * Hotfix: Missing js-map file causing plugin breakdown.

#### 1.4.0

 * Feat: Setup custom WP store to prevent props drilling across components.
 * Feat: Added translation languages for `Japanese`,`Indonesian`, `Turkish`, `Polish`,`
   Dutch`,`Danish`, `Brazil` and `Portuguese`.
 * Refactor: Replaced hard coded HTTP verbs with `WP_REST_Server` constant.
 * Refactor: Simplified register mimes.
 * Refactor: Used webpack generated dependencies.
 * Refactor: Replaced fully qualified path classes with their `use` counter part
 * Refactor: Replaced `get-400-response` with `get-error-`response` and sets 400
   as the default status.
 * Test: Updated the `js` unit test.
 * Chore: Pull Request template added.

#### 1.3.4

 * Specify `wordpress-plugin` as Composer package type.
 * Tested up to WP 6.9.

#### 1.3.3

 * Bump up plugin version.
 * Tested up to WP 6.8
 * Update README docs.

#### 1.3.2

 * Lint `.wp-env` file correctly.
 * Update setup.sh bash script.
 * Tested up to WP `6.7.2`.

#### 1.3.1

 * Enforce WP linting style across plugin.
 * Feat: Add WP local dev env for contributors.

#### 1.3.0

 * Fix: Ensure REST response on SQL Import.
 * Feat: Add Progress bar to Parse activity.
 * Feat: Implement Purge component.
 * Refactor: Move Interval logic to ProgressBar component.
 * Refactor: Move Handle logic away from App to ImportButton component.
 * Chore: Update doc blocks for components.
 * Tested up to WP 6.7.1

#### 1.2.2

 * Refactor: Parser instance via DI logic.
 * Fix: Breaking WP dependency.
 * Fix: Failing Unit tests.
 * Tested up to WP 6.7.1

#### 1.2.1

 * Chore: Add accessibility roles for components.
 * Updated Unit Tests for same.
 * Tested up to WP 6.7.1.

#### 1.2.0

 * Feat: Implement Import Progress bar.
 * Refactor: `sqlt_cpt_post_title` to `sqlt_cpt_post_values`.
 * Chore: Clean up App components.
 * Chore: Fix typos in README.
 * Add Unit Tests & Test Coverage.
 * Tested up to WP 6.7.1.

#### 1.1.0

 * Fix missing `Import` route class.
 * Implement `Post` class for handling CPTs.
 * Add new Custom Hooks: `sqlt_cpt_post_title`, `sqlt_cpt_post_labels`, `sqlt_cpt_post_options`.
 * Add new screenshot images.
 * Update README notes.
 * Tested up to WP 6.7.1.

#### 1.0.1

 * Change hook names to use `sqlt` prefix.
 * Custom Hooks now bear `sqlt_cpt_table_name`, `sqlt_cpt_table_columns`, `sqlt_cpt_table_rows`.
 * Tested up to WP 6.6.2.

#### 1.0.0

 * Add ability to upload SQL file to Custom Post Type (CPT).
 * Custom Hooks `sqlt_cpt_table_name`, `sqlt_cpt_table_columns`, `sqlt_cpt_table_rows`.
 * Custom Options page.
 * Fix bugs & linting issues.
 * Tested up to WP 6.6.2.

## 中繼資料

 *  版本 **1.4.1**
 *  最後更新 **1 個月前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 6.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.9.4**
 *  PHP 版本需求 ** 7.4 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/sql-to-cpt/)
 * 標籤:
 * [convert](https://tw.wordpress.org/plugins/tags/convert/)[cpt](https://tw.wordpress.org/plugins/tags/cpt/)
   [import](https://tw.wordpress.org/plugins/tags/import/)[post](https://tw.wordpress.org/plugins/tags/post/)
   [sql](https://tw.wordpress.org/plugins/tags/sql/)
 *  [進階檢視](https://tw.wordpress.org/plugins/sql-to-cpt/advanced/)

## 評分

這個項目尚無任何評論記錄。

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

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

## 參與者

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

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

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