2

I have just created a post called dolphin with the category species, but it apperas like

http://example.com/dolphin/

How can I set the species category appear in the URL..like

http://example.com/especies/dolphin/

and in the breadcrumb too

Thanks!

  • what are your permalink settings? – Michael Jul 1 '17 at 22:20
0

What you are looking for is called pretty permalink. You can set it in the WordPress's settings.

Head over to Settings > Permalinks. You will notice there are couple of options in the Common Settings section. What you want is a custom structure that isn't available in the list. You have to add it yourself.

Add this to your custom permalink structure:

/%category%/%postname%/

So your full permalink will be like:

http://example.com/%category%/%postname%/

This will append the category, and then the post's name to your URLs.

If you want to change the breadcrumb's structure, you need to add its code to your question. It's not possible to tell you how to solve it without seeing how it's generated.

To remove the category base from your permalink, you can add this rewrite rule to your .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^category/(.+)$ http://example.com/$1 [R=301,L]
</IfModule>

This will change http://example.com/category/blog to http://example.com/blog. Remember to change example.com to your site's URL (pay attention to www)

You can also do this by installing one FV Top Level Cats or Remove Category URL plugin. Yoast also provides this.

There was a trick that would allow you to do this without installing any plugin, but it doesn't work since version 4.6. In this trick, you would fill the category base with a period . which would remove the category word from the URL, but don't do this. It doesn't work anymore, and will get you into an infinite redirect.

  • It solved almost everything Jack, ty. Now, my breadcrumb is ok, home/especies/dolphin but When I click "especies" in breadcrumb, it open this page: mysite/category/especies/ Is there any way to make it mysite/especies/ without the "category" ? Ty – Dinhu Jul 1 '17 at 23:40
  • @Dinhu You're welcome. There was a trick that used to work on older versions to do this, but not anymore. However, you can install one of these simple plugins to remove the category word: FV Top Level Cats or Remove Category URL – Jack Johansson Jul 1 '17 at 23:51
  • Its done...ty man ! – Dinhu Jul 2 '17 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.