如何从WordPress的子页面URL中删除父子弹

Do you want to remove the parent page slug from child page url in WordPress? By default, WordPress adds parent page’s slug as a prefix to child page URLs which is good for SEO. However, some people may not want parent page slug in the URL. In this article, we will show you how to remove parent page slug from child page URL in WordPress.

您是否要从WordPress的子页面网址中删除父页面插件? 默认情况下,WordPress将父页面的子段添加为子页面URL的前缀,这对SEO很有用。 但是,有些人可能不希望URL中插入父页面。 在本文中,我们将向您展示如何从WordPress的子页面URL中删除父页面标签。

Remove parent page slug from child page URL
WordPress中的父页面标签是什么? (What is a Parent Page Slug in WordPress?)

WordPress comes with two main content types called posts and pages. Pages are hierarchical which means they can have child pages. By default, the URL of a child page in WordPress will have its parent page’s slug in the URL like:

WordPress带有两种主要的内容类型,称为帖子和页面 。 页面是分层的,这意味着它们可以具有子页面 。 默认情况下,WordPress中子页面的URL将在URL中带有其父页面的子段,例如:

http://example.com/parent-page/child-page/

http://example.com/parent-page/child-page/

This is a better way to organize content if you are using hierarchical page structure on your website. It is considered best practice for WordPress SEO, and it makes sense for your users as well.

如果您在网站上使用分层页面结构,则这是组织内容的更好方法。 它被认为是WordPress SEO的最佳实践,对您的用户也很有意义。

Removing the parent page slug can potentially break the URL, but in some expert opinion, it also makes it less SEO friendly. Sometimes it may cause conflicts with the WordPress permalink structure.

删除父页面段可能会破坏URL,但是在某些专家看来,这也使其对SEO的友好程度降低 。 有时可能会导致与WordPress永久链接结构发生冲突。

In our experience, if you don’t want parent page slug in your child page URL, then the best approach is to not create a child page at all. Instead, you can simply create a page and use navigation menus to show that it belongs under this page.

根据我们的经验,如果您不想在子页面URL中插入父页面,那么最好的方法就是根本不创建子页面。 相反,您可以简单地创建一个页面并使用导航菜单显示该页面属于该页面。

Adding child items to a menu

However, we understand that some users may still want to use child-pages for their own reasons.

但是,我们了解到某些用户出于自身原因可能仍希望使用子页面。

That being said, let’s take a look at how to easily remove parent page slug from child page URL in WordPress.

话虽如此,让我们看一下如何轻松地从WordPress的子页面URL中删除父页面插件。

从WordPress的子页面URL中删除父页面子标签 (Removing Parent Page Slug from Child Page URL in WordPress)

First thing you need to do is install and activate the Custom Permalinks plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活Custom Permalinks插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to edit the child page you want to change. Under the page title, you will see the option to change the child page URL.

激活后,您需要编辑要更改的子页面。 在页面标题下,您将看到更改子页面URL的选项。

Change child page URL

The placeholder area will show your page’s current default URL. You need to click on it and enter the custom URL you want to use for your child page.

占位符区域将显示页面的当前默认URL。 您需要单击它,然后输入要用于子页面的自定义URL。

Custom page URL

Don’t forget to save your page to store your URL changes.

不要忘记保存页面来存储URL更改。

After saving your changes, you can click on the view page button to view your child page URL without parent page slug.

保存更改后,您可以单击查看页面按钮以查看您的子页面URL,而不会出现父页面错误。

We hope this article helped you learn how to remove parent page slug from child page URL in WordPress. You may also want to see our list of the best drag and drop page builder plugins for WordPress.

我们希望本文能帮助您学习如何从WordPress的子页面URL中删除父页面标签。 您可能还希望查看我们的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-remove-parent-slug-from-child-page-url-in-wordpress/

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值