网站优化

网站优化

Products

当前位置:首页 > 网站优化 >

删除WordPress网址中的类别

GG网络技术分享 2025-03-18 16:12 10


问题描述:

I have a WordPress blog with posts that has categories, this could be an example of my url:

www.example.it

The url for my post is now:

www.example.it/sample-post

The url for my category list of posts is now:

www.example.it/category/my-category

I would like my urls like this:

wwww.example.it/sample-post (for posts)

www.example.it/my-category (for categories)

After googled I founded this solution that I tried:

Go to Setting > Permalinks

Select Custom Structure

Add /%category%/%postname%/ after your domain

Change Category Base to period/dot.

In this way the category url is correct:

www.example.it/my-category

but post url is not:

www.example/my-category/sample-post

What could I change for get the url like I want?

网友观点:

Restore the permalink selecting \\\"Post name\\\" and then install this plugin. No configuration needed, it replaces the word \\\"category\\\" in the url of category template.

https://wordpress.org/plugins/no-category-parents/

###

You don\'t need PHP to do this, just go to Settings->Permalinks and select \\\"Post name\\\".

If you want to make some custom link structure, please take a look at Wordpress Codex

###

Remove %category% from your permalink structure and install Remove Category URL plugin.

标签:

提交需求或反馈

Demand feedback