从 WordPress 默认分类永久链接结构中删除前面

Remove front from WordPress default taxonomy permalink structure

在 WordPress 中,

我有这样的永久链接结构:

example.com/blog/%postname%/

这是我的博客和 posts 想要的,但这会创建默认的分类永久链接结构:

example.com/blog/category/slug-here/
example.com/blog/tag/slug-here/

相反,我需要它没有前面('blog'),例如

example.com/category/slug-here/
example.com/tag/slug-here/

我也在自定义 post 类型上使用默认类别和标签,所以我不希望永久链接包含“/blog/”基础。

这只是将类别和标签的 with_front 设置为 false 的问题吗?

找到答案。

在 WordPress 设置中,在永久链接下。

当类别和标签库为空时,它们被设置为默认结构,只需在类别库中添加'category',在标签库中添加'tag'。