AnswerBun.com

Remove/hide a specify category-name from the url

WordPress Development Asked by andresgl on January 4, 2022

I have several categories post:

General
News
Comedy
Competitions
Culture
Gaming
Food
etc

The posts url are in the following format:

www.mydomain.com/category-name/post-title

Example:

www.mydomain.com/food/how-to-make-paella
www.mydomain.com/gaming/game-of-theday

But I would like to hide from the URL the category name ‘general’ so for example.

instead of

www.mydomain.com/general/how-to-learn-spanish

have

www.mydomain.com/how-to-learn-spanish

I have tried some wiring a rewrite rule in the .htaccess but doesn’t work.

Any idea how can I do it?

Thanks!

2 Answers

Have you tried following Rewrite rule in your .htaccess ?

RewriteRule ^category/(.+)$ http://YOUR_SITE_NAME/$1 [R=301,L]

Answered by JItendra Rana on January 4, 2022

You can use post name in your permalinks setting. And for Category Base and Tag Base make it blank

Hope this will help

Answered by Aftab on January 4, 2022

Add your own answers!

Related Questions

No more get_option(‘date_time’) in WordPress 5.5?

1  Asked on February 10, 2021 by wittich

       

How should I tackle this situation?

0  Asked on February 9, 2021 by remus

   

How to create an anonymous forum?

0  Asked on February 8, 2021 by keyrands

   

Detect if REST API is running

2  Asked on February 8, 2021 by tom-j-nowell

 

Create a bulk action to pass user profiles into a CPT

0  Asked on February 6, 2021 by zaesar

     

Can’t update WordPress with Admin Users

0  Asked on February 4, 2021 by charlene-the-web-design-queen

       

Get Child Category only

1  Asked on February 2, 2021 by joamika

   

MULTISITE: Password issue and Error Cant access site

3  Asked on January 31, 2021 by msn_administrator

 

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP