如何在WordPress中将经典块批量转换为古腾堡

Several of our readers have asked how to convert old WordPress post content into the new Gutenberg (block) format in WordPress.

我们的一些读者问过如何将旧的WordPress帖子内容转换为WordPress中的新的Gutenberg(块)格式。

After you update to any version above WordPress 5.0, your older post and page content will show up inside a Classic block in the new WordPress content editor.

更新到WordPress 5.0以上的任何版本后,您较旧的帖子和页面内容将显示在新WordPress内容编辑器中的Classic块中。

To convert the content into individual blocks, you would need to edit each post and page separately. If you have dozens or hundreds of posts, then this can take a lot of time. Thankfully, there’s a bulk convert option.

要将内容转换为单独的块,您需要分别编辑每个帖子和页面。 如果您有数十或数百个帖子,那么这可能会花费很多时间。 幸运的是,有一个批量转换选项。

In this article, we will show you how to bulk convert classic blocks to individual Gutenberg blocks in WordPress.

在本文中,我们将向您展示如何在WordPress中将经典块批量转换为单个Gutenberg块。

How to convert classic blocks to Gutenberg in WordPress
了解“经典”障碍 (Understanding the “Classic” Block)

If you installed WordPress before version 5.0 came out, the posts and pages you created used the old or Classic editor.

如果您在5.0版本发布之前安装了WordPress ,则您创建的帖子和页面将使用旧的或经典的编辑器

When you upgrade WordPress to version 5.0 or later, all your old posts and pages still need to be editable. This means that WordPress automatically places the content for those posts and pages inside a single “Classic” block:

将WordPress升级到5.0或更高版本时,所有旧帖子和页面仍需要可编辑。 这意味着WordPress会自动将这些帖子和页面的内容放在一个“经典”块中:

A post that WordPress has automatically converted into a Classic block

This makes sure that your old posts and pages are still editable, and they look the same on the front-end of your website even if you don’t convert the content into individual blocks.

这样可以确保您以前的帖子和页面仍然可编辑,并且即使您不将内容转换成单独的块,它们在网站的前端看起来也一样。

However, if you want you can convert them from a single classic block into the new multi-block format used by the WordPress block editor.

但是,如果您愿意,可以将它们从单个经典块转换为WordPress块编辑器使用的新的多块格式。

The Classic block contains all the post content, such as images, embeds, text, and more. You can go to any of the old posts on your site to see how the Classic block looks.

经典版块包含所有帖子内容,例如图像,嵌入,文本等。 您可以转到网站上的所有旧帖子,以查看“经典”块的外观。

If you select the block by clicking on it, you can see the block type. This appears just above the block in the top left-hand corner and also in the Block settings on the right-hand side.

如果通过单击选择块,则可以看到块类型。 它显示在块的左上角,也显示在右侧的块设置中。

You can edit the content in the Classic block. Most users, though, will want to update their old posts to the new block format for ease of editing.

您可以在“经典”块中编辑内容。 不过,大多数用户都希望将其旧帖子更新为新的块格式,以便于编辑。

We covered this process in detail in our article on how to update your old WordPress posts with the Gutenberg block editor, but let’s quickly recap.

我们在有关如何使用Gutenberg块编辑器更新旧WordPress帖子的文章中详细介绍了此过程,但让我们快速回顾一下。

To convert an individual Classic block into new Gutenberg blocks, you can click the ‘More Options’ button (three dots in a vertical line), and then click ‘Convert to Blocks’.

要将单个Classic块转换为新的Gutenberg块,可以单击“更多选项”按钮(垂直线三个点),然后单击“转换为块”。

Converting an individual post to the new blocks format

Your post will then be converted into separate blocks. As you can see, the text and images have been separated here. The text is in the new ‘Paragraph’ block.

然后,您的帖子将转换为单独的块。 如您所见,此处的文本和图像已分开。 文本位于新的“段落”块中。

A paragraph block in the converted post

This process is quick and straightforward for a single post. However, WordPress doesn’t have a built-in way to do it automatically for every post.

对于单个帖子,此过程快速而直接。 但是,WordPress没有内置的方法可以针对每个帖子自动执行此操作。

If you want to switch a lot of posts to the new Gutenberg block format at once, then you’ll need a bulk converter plugin.

如果您想一次将很多帖子切换到新的Gutenberg块格式,那么您将需要一个批量转换器插件。

将经典块批量转换为古腾堡块 (Bulk Convert Classic Block into Gutenberg Blocks)

First, you need to install and activate the Bulk Block Converter plugin. For more details, see our step by step guide on how to install a WordPress plugin.

首先,您需要安装并激活Bulk Block Converter插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, go to Tools » Block Conversion in your WordPress dashboard. You’ll see the following screen:

激活后,转到WordPress仪表板中的“ 工具”»“块转换” 。 您会看到以下屏幕:

Viewing the Bulk Block Conversion page

Tip: Make sure you create a complete WordPress backup of your site before using the bulk block converter. You cannot undo the conversion once it’s taken place.

提示:在使用批量块转换器之前,请确保您创建了网站的完整WordPress备份 。 转换一旦发生就无法撤消

To start, click the ‘Scan Content’ button and the converter will find all your content that’s ready for conversion.

首先,单击“扫描内容”按钮,转换器将找到您准备好进行转换的所有内容。

List of scanned content ready for conversion

Note: Posts that use a mix of Classic blocks and other blocks won’t be picked up by the converter.

注意:混合使用Classic区块和其他区块的帖子将不会被转换器接收。

If you want to convert all the content on your site at once, simply click the large ‘Bulk Convert All’ button at the top of the screen.

如果要一次转换站点上的所有内容,只需单击屏幕顶部的大“全部转换全部”按钮。

The Bulk Convert All button

You’ll see a warning like this. Go ahead and click ‘OK’ to continue.

您会看到这样的警告。 继续并单击“确定”继续。

The bulk conversion warning

If you don’t want to convert everything at once, that’s fine too. You can filter the list by ‘Post Type’ (posts or pages). You can also switch to the ‘Published’ or ‘Drafts’ lists to see only that set of posts.

如果您不想一次转换所有内容,那也可以。 您可以按“帖子类型”(帖子或页面)过滤列表。 您也可以切换到“已发布”或“草稿”列表,以仅查看该组帖子。

You can select everything on your list by clicking the checkbox to the left of ‘Title’. We’ll filter our list to show pages, not posts, and then select all of them:

您可以通过单击“标题”左侧的复选框来选择列表中的所有内容。 我们将过滤列表以显示页面,而不是帖子,然后选择所有页面:

A list of pages only, ready to convert

You can even select individual posts and pages by clicking on the checkbox to the left of their title.

您甚至可以通过单击标题和左侧的复选框来选择各个帖子和页面。

Note that if you use this method, you won’t see the warning before the conversion takes place. Once each piece of content is converted, you’ll see ‘Converted’ listed next to it in the table.

请注意,如果使用此方法,则在进行转换之前不会看到警告。 转换完每条内容后,您会在表格中看到“已转换”旁边列出的内容。

The pages have now been converted to the new block format

Important Tip About Shortcodes

关于简码的重要提示

One snag you might run into is that the Bulk Block Conversion tool doesn’t convert shortcodes. It’ll create a shortcode block for you, but you’ll need to put the shortcode itself back in manually.

您可能会遇到的一个麻烦是,批量转换工具不会转换简码 。 它将为您创建一个简码块,但是您需要手动将简码本身放回去。

The converted contact page with a blank Shortcode block

If you’re using shortcodes, then make sure you note them down before running the bulk converter. Otherwise, it could take a while to figure out which shortcodes you need to put back and where to place them.

如果您使用的是简码,请确保在运行批量转换器之前记下它们。 否则,可能需要一段时间才能弄清楚您需要放回哪些短代码以及将其放置在何处。

We hope this article helped you learn how to bulk convert classic blocks to Gutenberg in WordPress. You may also want to see our comparison of the best WordPress drag & drop page builders and the best WordPress contact form plugins.

我们希望本文能帮助您学习如何在WordPress中将经典块批量转换为Gutenberg。 您可能还需要查看我们对最佳WordPress拖放页面构建器最佳WordPress联系人表单插件的比较

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-bulk-convert-classic-blocks-to-gutenberg-in-wordpress/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值