Convert to Blocks

外掛說明

Convert to Blocks 是能將傳統編輯器內容即時轉換為區塊的 WordPress 外掛。安裝 Gutenberg 外掛或升級至 WordPress 5.0 或更新版本後,網站內容會顯示為 [傳統編輯器] 區塊。這些區塊能具備完整功能,也能在網站前端正確顯示內容,但是會使得內容作者無法充分發揮區塊編輯功能;為了充分發揮區塊編輯功能,傳統編輯器產出的內容必須轉換為區塊內容。這個外掛能完成即時轉換,當區塊編輯器編輯傳統編輯器產出的內容時,相關內容會剖析為區塊內容。只要在區塊編輯器中儲存內容,內容的新結構便會儲存至資料庫中。這個方式可以降低風險,因為僅需變更內容的資料庫值。

請注意,內部區塊轉換支援必須安裝 Gutenberg 10.9.0 或 WordPress 5.9 的更新版本。

螢幕擷圖

  • 使用 WP-CLI 命令 wp convert-to-blocks start 便能在瀏覽器中重複轉換文章進行批次移轉,而不需手動輸入

安裝方式

手動安裝

  1. 將外掛安裝套件解壓縮所得的 convert-to-blocks 資料夾上傳至網站的 /wp-content/plugins/ 目錄。
  2. 在 WordPress 管理後台的 [外掛] 選單中啟用 Convert to Blocks。

常見問題集

如何知道外掛是否已執行?

在內容中找到傳統編輯器,然後試著離開該頁面,便會顯示「系統可能不會儲存變更」的提示訊息,這是因為 Convert to Blocks 會即時將網站內容轉換為區塊,且這些變更會在更新內容後才儲存。

Convert to Blocks 是否能處理自訂區塊?

預設無法處理。

Convert to Blocks 是否能處理巢狀區塊?

如果 WordPress 核心程式版本低於 5.7.2 (含),這個外掛所需的巢狀/內部區塊支援,無法正確執行於這些版本所整合的 Gutenberg 功能。這項功能所需的 Gutenberg 外掛版本需要高於 10.9.0 (含),即 WordPress 5.9 或更新版本。

使用者評論

2024 年 5 月 20 日 1 則留言
When you run a command and open a URL, the browser opens articles one after another and converts them into blocks. It magically automatically converts blocks quickly and accurately.
2024 年 4 月 9 日 1 則留言
Saves me a lot of time. Used it two times on large projects. I did not try the bulk option, but I just read that it can have bugs or crashes. Probably due to server load or unusual post content? What I did instead was create a button that that when pressed automatically opens in a new tab the 20 posts from the Posts Table view. I then waited for them to load. After they were all loaded I went to each page and updated the page. I then waited a while for all of them to be saved and double checked in the Posts Table if all the posts were converted to the Block editor. The little icon showing if the post is Classic or Block comes very handy! Once I confirmed that all 20 posts from the Posts Table view were converted I moved to the next page and repeated the process. This semi-automated process helps prevent “bugs” or perhaps random server spikes. I was running this on my own private cloud server with little resources. Surprisingly saving 20 posts at once was possible without any crashes. I did not have any bugs or issues. Thank you for creating this plugin!
2024 年 4 月 2 日 2 則留言
I have a load of old posts and pages done in the original WP editor which desperately needed converting to blocks in order to play nicely with a child theme I was working on. We know the block editor has the facility to go through posts/pages one-by-one and convert to blocks – but this is painful…. This plugin seems to do that job for you, but silently in the background. Once I’d activated it and saved the settings, nothing happened….at least, not visually. It was only when I started to look at the entries made in the legacy editor that I could see they had been converted to block format – silently! The only improvement I can suggest is a message on the plug-in interface page which says something like, “when you have ticked the checkboxes, press the save button and your conversion will commence as a background task.” I don’t know if that would make sense in keeping with the way the plug-in works. I only have a couple of hundred posts so it did the job quickly. I don’t know how it would perform on a site with thousands of old posts in legacy editor format. Either way, thanks to the author for saving me the time.
2023 年 11 月 6 日 2 則留言
Very good plugin, which helps to migrate a lot of posts. We have a project with ~8000 posts, which needs to be converted. Only standard text and images… Unfortunatly WordPress itself is pushing Gutenberg, but not providing tools for this task. This plugin is helping a lot. Basically it opens the browser, clicks the button, saves the post, opens the next post … A quite clever solution, which unfortunately is slow and sometimes breaks.. Means you have to monitor the task and reload the tab from time to time…
2023 年 7 月 3 日 1 則留言
Works as expected.. very useful tool.
2023 年 6 月 8 日 1 則留言
This is the only plugin that is actively maintained and gets the job done. I see that in the next revision it will receive basic settings on which post types it works on, but until then, read the support for the solution to the problem that you have lost Gutenberg on all custom post types.
閱讀全部 8 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Convert to Blocks〉的開發相關工作。

參與者

〈Convert to Blocks〉外掛目前已有 4 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Convert to Blocks〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.3.1 – 2024-08-20

1.3.0 – 2024-05-14

1.2.2 – 2023-10-16

1.2.1 – 2023-07-26

1.2.0 – 2023-06-27

Note that this release bumps the WordPress minimum version from 5.7 to 6.1 and the PHP minimum version from 7.4 to 8.0.

1.1.1 – 2023-01-05

Note that this version bumps the minimum PHP version from 7.0 to 7.4 and the minimum WordPress version from 5.4 to 5.7.

  • Added: Bulk migration demo to readme (props @jeffpaul, @dsawardekar via #79).
  • Added: Release build GitHub Action to build a release zip used for testing (props @dkotter via #98).
  • Changed: Bump WordPress minimum version from 5.4 to 5.7 and PHP minimum version from 7.0 to 7.4 (props @zamanq, @jeffpaul, @faisal-alvi, @mehul0810 via #80).
  • Changed: Bump WordPress “tested up to” version to 6.1 props @peterwilsoncc, @faisal-alvi, @cadic via #88, #91).
  • Removed: is-svg as it is no longer used after updating ancestor dependency postcss-svgo (props @dependabot via #85).
  • Fixed: WP-CLI helptext that is causing an unknown parameter error (props @dsawardekar, @jeffpaul, @norcross via #78).
  • Security: Bump socket.io-parser from 3.2.0 to 4.2.1 and browser-sync from 2.26.7 to 2.27.10 (props @dependabot via #81).
  • Security: Bump minimatch from 3.0.4 to 3.1.2 (props @dependabot via #82).
  • Security: Bump nth-check from 1.0.2 to 2.1.1 and cssnano from 4.1.10 to 5.1.14 (props @dependabot via #84).
  • Security: Bump postcss-svgo from 4.0.2 to 4.0.3 (props @dependabot via #85).
  • Security: Bump minimist from 1.2.0 to 1.2.7 and mkdirp from 0.5.1 to 0.5.6 (props @dependabot via #86).
  • Security: Bump loader-utils from 1.2.3 to 1.4.2 and webpack-cli from 3.3.10 to 3.3.12 (props @dependabot via #89).
  • Security: Bump glob-parent from 5.1.0 to 5.1.2 and watchpack from 1.6.0 to 1.7.5 (props @dependabot via #90).
  • Security: Bump kind-of from 6.0.2 to 6.0.3 (props @dependabot via #93).
  • Security: Bump serialize-javascript from 2.1.2 to 4.0.0 and terser-webpack-plugin from 1.4.3 to 1.4.5 (props @dependabot via #94).
  • Security: Bump engine.io from 6.2.0 to 6.2.1 (props @dependabot via #95).
  • Security: Bump decode-uri-component from 0.2.0 to 0.2.2 (props @dependabot via #97).

View historical changelog details here.