如何在WordPress中重命名未分类的类别

If you have wanted to rename the Uncategorized category in WordPress, then you’re not the first one. Often WordPress beginners ask us if it’s possible to remove or rename the uncategorized category in WordPress. In this article, we will show you how to rename the uncategorized category, and how to change the default category in WordPress.

如果您想在WordPress中重命名“未分类”类别,那么您不是第一个。 WordPress初学者经常问我们是否可以删除或重命名WordPress中未分类的类别。 在本文中,我们将向您展示如何重命名未分类的类别,以及如何更改WordPress中的默认类别。

Rename Default Category in WordPress
WordPress中的默认类别是什么? (What is Default Category in WordPress?)

Categories and tags are the two default taxonomies that come with every new WordPress install. By design, your WordPress posts must be filed under at least one category.

类别和标签是每个新的WordPress安装随附的两个默认分类法 。 根据设计,您的WordPress帖子必须至少归为一类。

If you forget to assign a category to your post, then it is automatically filed under your default category. On a new WordPress install, this default category is titled ‘Uncategorized’.

如果您忘记为帖子分配一个类别,则该帖子将自动保存在您的默认类别下。 在新安装的WordPress上,此默认类别的标题为“未分类”。

Default Uncategorized category in WordPress

Usually, you can just go to Posts » Categories and delete a category. However, you cannot delete a default category until you assign another category to be used as default.

通常,您可以转到帖子»类别并删除类别。 但是,您不能删除默认类别,除非您分配另一个类别用作默认类别。

There are two ways to solve this issue. You can either rename the default category from uncategorized to something more meaningful, or you can set a new default category.

有两种方法可以解决此问题。 您可以将默认类别从未分类重命名为更有意义的名称,也可以设置新的默认类别。

Having said that, let’s see how you can rename uncategorized category or set a new default category.

话虽如此,让我们看看如何重命名未分类的类别或设置新的默认类别。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

重命名WordPress中未分类的类别 (Renaming Uncategorized Category in WordPress)

You cannot delete a default category, but you can rename it. You need to visit Posts » Categories page in the WordPress admin and click on the edit link below the Uncategorized category.

您不能删除默认类别,但可以重命名。 您需要访问WordPress管理员中的帖子»类别页面,然后单击未归类类别下方的编辑链接。

Edit Uncategorized category to rename it

This will bring you to the category edit screen where you can rename your category and change its URL slug.

这将带您进入类别编辑屏幕,您可以在其中重新命名类别并更改其URL slug

Renaming category

If your site is not live or indexed by search engines, then you can change the URL slug.

如果您的网站不是实时网站,也不是被搜索引擎索引的网站,则可以更改网址段。

However, if your site is live, then changing the URL slug will result into 404 errors when search engines or actual users visit the old URL.

但是,如果您的网站是在线的,那么当搜索引擎或实际用户访问旧URL时,更改URL链接将导致404错误

Don’t worry, we will show you how to setup redirects later in this article.

不用担心,我们将在本文后面向您展示如何设置重定向。

更改WordPress中的默认类别 (Changing Default Category in WordPress)

You can also easily change the default category in WordPress. First make sure you have a category other than uncategorized available.

您还可以轻松更改WordPress中的默认类别。 首先,请确保您具有未分类可用的类别。

If you have a category that you would like to use as default, then you can skip this step. Otherwise, go to Posts » Categories and create a new category.

如果您要使用默认类别,则可以跳过此步骤。 否则,请转到帖子»类别并创建一个新类别。

Add new category in WordPress

Now visit Settings » Writing page. The first option on the page is to set a default post category.

现在访问设置»写作页面。 页面上的第一个选项是设置默认的帖子类别。

Click on the drop down menu next to it and select the default category you would like to use.

单击其旁边的下拉菜单,然后选择要使用的默认类别。

Default post category setting in WordPress

Don’t forget to click on the save changes button to store your settings.

不要忘记单击“保存更改”按钮来存储您的设置。

WordPress will now use the category you selected as the default category. If you forget to assign a category to a post, then it will be filed under this default category.

WordPress现在将使用您选择的类别作为默认类别。 如果您忘记为帖子指定类别,那么它将被归入此默认类别下。

However, posts filed under uncategorized will not be moved to the new category. You can edit those posts and change their category.

但是,未归类的帖子将不会被移到新的类别。 您可以编辑这些帖子并更改其类别。

If there are just a couple of posts, then you can do it manually. Otherwise, you may want to check out our guide on how to bulk move posts to categories and tags in WordPress.

如果只有几篇文章,那么您可以手动进行。 否则,您可能需要查看我们的指南,以了解如何将帖子批量移动到WordPress中的类别和标签

You can also delete the ‘Uncategorized’ category. If a post was only filed under uncategorized, then it will be automatically moved to your new default category.

您也可以删除“未分类”类别。 如果帖子仅归入未归类,则它将被自动移至新的默认类别。

重定向旧的未分类URL (Redirecting Old Uncategorized URL)

If your site was live when you renamed the uncategorized category slug, or deleted the uncategorized category, then users and search engines will see a 404 page for the old URL.

如果您的网站在重命名未分类的类别标签或删除未分类的类别时处于活动状态,则用户和搜索引擎将看到旧URL的404页面。

Here is how you can easily fix that and redirect users to your new category URL or the renamed URL.

这是您可以轻松解决该问题并将用户重定向到新类别URL或重命名URL的方法。

First you need to install and activate the Simple 301 Redirects plugin. For more details, see our step by step guide on how to install a WordPress plugin.

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

Upon activation, you need to visit Settings » 301 Redirects page and enter your old uncategorized url in the Request field and your new URL into the destination field.

激活后,您需要访问“设置»301重定向”页面,并在“请求”字段中输入旧的未分类URL,然后在目标字段中输入新的URL。

Setting up redirects

For example, if your old uncategorized URL was like this

例如,如果您的旧未分类网址是这样的

http://example.com/category/uncategorized/

http://example.com/category/uncategorized/

Then you will enter /category/uncategorized/ in the request field.

然后,您将在请求字段中输入/category/uncategorized/

In the destination field, you need to enter the full new URL. For example:

在目标字段中,您需要输入完整的新URL。 例如:

http://example.com/category/general/

http://example.com/category/general/

Don’t forget to click on the save changes button to store your settings. For detailed instructions see our beginner’s guide to creating redirects in WordPress.

不要忘记单击“保存更改”按钮来存储您的设置。 有关详细说明,请参阅我们的初学者指南,以在WordPress中创建重定向

That’s all. Now visitors coming to your old ‘Uncategorized’ category URL, will be redirected to the new URL.

就这样。 现在,访问您旧的“未分类”类别URL的访问者将被重定向到新URL。

We hope this guide helped you learn how to rename uncategorized category as well as how to set a new default category in WordPress. You may also want to check out our 10 most wanted category hacks and plugins for WordPress.

我们希望本指南可以帮助您学习如何重命名未分类的类别以及如何在WordPress中设置新的默认类别。 您可能还想查看我们针对WordPress的10个最想要的类别黑客和插件

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/beginners-guide/rename-the-uncategorized-category/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值