Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Wie man Kategorie und Unterkategorie in WordPress-URLs einfügt

Hinweis der Redaktion: Wir erhalten eine Provision für Partnerlinks auf WPBeginner. Die Provisionen haben keinen Einfluss auf die Meinung oder Bewertung unserer Redakteure. Erfahre mehr über Redaktioneller Prozess.

Möchten Sie die Kategorie und die Unterkategorie Ihrer Blogbeiträge in die WordPress-URLs aufnehmen?

Mit Kategorien und Unterkategorien können Sie die Inhalte auf Ihrer Website sortieren. Sie ermöglichen es Ihren Nutzern auch, die Themen, die sie am meisten interessieren, einfach zu durchsuchen.

In diesem Artikel zeigen wir Ihnen, wie Sie die Kategorie und Unterkategorie in WordPress-URLs einfügen.

How to Include Category and Subcategory in WordPress URLs

Wann die Kategorie und Unterkategorie in WordPress-URLs enthalten sein sollten

Einige WordPress-Websites verwenden Kategorien und Unterkategorien in ihren URLs, wenn sie viele Inhalte auf ihren Websites haben und diese besser organisieren wollen. Bei WPBeginner verwenden wir diese Strategie, um unseren Lesern die Navigation auf unserer Website zu erleichtern.

Zum Beispiel:

https://www.wpbeginner.com/plugins/7-best-wordpress-backup-plugins-compared-pros-and-cons/

Für Online-Shops bietet die Aufnahme von Kategorien und Unterkategorien in URLs einen visuellen Hinweis auf den Inhalt, auf den die Kunden zugreifen werden, was das Benutzererlebnis verbessern kann.

Eine URL wie onlinestore.com/books/fiction/thriller zeigt beispielsweise an, dass der Benutzer zu einer bestimmten Unterkategorie innerhalb einer umfassenderen Kategorie auf der WordPress-Website navigiert.

Die Aufnahme von Kategorien und Unterkategorien in die URLs kann Suchmaschinen auch helfen, die Struktur Ihrer Website zu verstehen. Die URL würde der Breadcrumb-Navigation auf Ihrer Website entsprechen und mehr Schlüsselwörter und Text enthalten, was Ihre Website SEO-freundlicher macht.

Weitere Informationen zu Kategorien finden Sie in unseren Leitfäden zu WordPress-Taxonomien und Kategorien vs. Tags: Beste SEO-Praktiken für die Sortierung Ihrer Inhalte.

Wenn Sie die Standard-URL-Struktur von WordPress verwenden, sind Ihre Kategorien und Unterkategorien nicht in den Post-URLs enthalten. Sehen wir uns also an, wie Sie ganz einfach Kategorien und Unterkategorien in WordPress-URLs hinzufügen können.

Einfaches Hinzufügen von Kategorien und Unterkategorien in WordPress Post-URLs

Hinweis: Wir raten davon ab, Permalinks zu ändern, wenn Ihre WordPress-Website bereits eine Weile in Betrieb ist (d. h. mehr als sechs Monate). Andernfalls können Sie Ihre Platzierungen in den Suchmaschinen verlieren.

Wenn Sie Ihre Permalink-Struktur ändern müssen, empfehlen wir Ihnen, Ihre Website für den Fall von Fehlern zu sichern und Weiterleitungen von den alten URLs zu den neuen zu erstellen.

Zunächst müssen Sie die Seite Einstellungen “ Permalinks in Ihrem WordPress-Admin-Dashboard aufrufen. Dort müssen Sie im Bereich Allgemeine Einstellungen auf die Option „Benutzerdefinierte Struktur“ klicken.

Adding category to WordPress post URLs

Als Nächstes müssen Sie /%category%/%postname%/ in das Feld neben der benutzerdefinierten Struktur hinzufügen.

Vergessen Sie anschließend nicht, auf die Schaltfläche „Änderungen speichern“ zu klicken, um Ihre benutzerdefinierten Einstellungen für die Permalinkstruktur zu speichern.

Das ist alles!

Save permalinks settings

WordPress beginnt nun, Kategorien und Unterkategorien in WordPress-URLs hinzuzufügen. Sie können die benutzerdefinierten Permalink-Einstellungen in Aktion sehen, indem Sie einen neuen Beitrag erstellen oder einen bestehenden Beitrag bearbeiten.

Weisen Sie dem Beitrag einfach eine Kategorie (und gegebenenfalls eine Unterkategorie) in der Seitenleiste zu und klicken Sie auf die Schaltfläche „Aktualisieren“.

WordPress URL with category and subcategory

Sie werden feststellen, dass der Name der Kategorie und der Name der Unterkategorie im Permalink des Beitrags enthalten sind.

Wie würde die URL aussehen, wenn ich mehrere Kategorien oder Unterkategorien verwende?

Nehmen wir an, Sie sortieren Ihre WordPress-Blogbeiträge in mehrere Kategorien oder Unterkategorien.

WordPress wird nur eine Kategorie und eine Unterkategorie in die URL aufnehmen. Wenn Sie keine Unterkategorie ausgewählt haben, wird nur eine übergeordnete Kategorie angezeigt.

WordPress wählt die Kategorie alphabetisch aus. Wenn Sie beispielsweise einen Beitrag in den Kategorien „Apfel“ und „Technik“ ablegen, wird WordPress „Apfel“ in die URL aufnehmen, da diese Kategorie in alphabetischer Reihenfolge an erster Stelle steht:

http://example.com/apple/article-title-here/

Wenn Sie einen Beitrag in der Kategorie „Apple“ und einer darunter liegenden Unterkategorie namens „Technologie“ ablegen, werden beide Kategorien in der URL aufgeführt:

https://example.com/apple/technology/article-title-here/

Wenn Sie eine Unterkategorie, aber keine übergeordnete Kategorie ausgewählt haben, wird WordPress trotzdem die übergeordnete Kategorie in die URL aufnehmen.

Ein anderes Szenario ist, dass Sie eine übergeordnete Kategorie, eine Unterkategorie und eine Unter-Unterkategorie haben. WordPress wird alle drei in den WordPress-Permalink aufnehmen:

https://example.com/apple/technology/events/article-title-here/

Weitere Informationen über Permalinks finden Sie in den folgenden WordPress-Anleitungen:

Wir hoffen, dass dieser Artikel Ihnen geholfen hat zu lernen, wie man eine Kategorie und Unterkategorie in WordPress-URLs einfügt. Vielleicht interessieren Sie sich auch für unsere schrittweise WordPress-SEO-Anleitung für Anfänger und unsere Expertenauswahl der besten WordPress-SEO-Plugins und -Tools.

Wenn Ihnen dieser Artikel gefallen hat, dann abonnieren Sie bitte unseren YouTube-Kanal für WordPress-Videotutorials. Sie können uns auch auf Twitter und Facebook finden.

Offenlegung: Unsere Inhalte werden von unseren Lesern unterstützt. Das bedeutet, dass wir möglicherweise eine Provision verdienen, wenn Sie auf einige unserer Links klicken. Mehr dazu erfahren Sie unter Wie WPBeginner finanziert wird , warum das wichtig ist und wie Sie uns unterstützen können. Hier finden Sie unseren redaktionellen Prozess .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Das ultimative WordPress Toolkit

Erhalte KOSTENLOSEN Zugang zu unserem Toolkit - eine Sammlung von WordPress-bezogenen Produkten und Ressourcen, die jeder Profi haben sollte!

Reader Interactions

56 KommentareEine Antwort hinterlassen

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. AB Juma says

    Hi there,

    Thank you for this. Very helpful.

    Just a question – I already have more than 2,000 posts on my website with the day and name url structure. If I change to custom, will those urls change too, or does the change only apply to new posts? Thanks.

  3. Jay says

    it’s only putting the Parent cateogry in the slug.
    How can i make it automatically put subcategory in the url as well?

    • WPBeginner Support says

      Please check that the post is only in the subcategory for the most likely reason for that issue.

      Admin

  4. Taoheed says

    I would be glad if you answer this. Let’s assume i published a post into two/three categories or sub-categories, wouldn’t it be treated as duplicate content on google?

    • WPBeginner Support says

      It should not cause Google to see it as duplicate content but if you have posts that are in multiple categories then your users would see that same post when they viewed your other categories. We would normally recommend only one category for a post.

      Admin

    • WPBeginner Support says

      We do not have a recommended method for including tags in your URL at the moment, we would recommend taking a look at our article below that covers the organizational differences between the two for why categories are preferred over tags in permalinks:
      wpbeginner.com/beginners-guide/categories-vs-tags-seo-best-practices-which-one-is-better/

      Admin

  5. Phu Nguyen says

    Hi,

    Currently I have a url: abc.com/games/ff9/weapon-list/

    and I can’t create another post with the same name (weapon-list) on another category.

    It will be like abc.com/games/ffx/weapon-list-1/

    Is there any solution for my case? Looking forward to your help

    • WPBeginner Support says

      The end of the URL would be determined by your post’s name and the other sections would be determined by your permalink structure. You cannot have the same name for the time being and would need a different name

      Admin

  6. Ashish says

    Is it a disadvantage to using categories in URL? like example.com/plugin/best-plugin/. in this case plugin uses 2 times. is this URL looks spammy?

    • WPBeginner Support says

      You would want to try avoiding looking spammy with your choice of title but it is not a disadvantage to use categories n your URL.

      Admin

  7. jacques says

    Important note: To get URL structure like: /category/child1/child2/POSTNAME then ONLY select „child2“ as the post category when editing the post. WordPress will automatically add all parent categories to the URL. Took me a while to figure that out.

  8. May says

    Is there a way to add hierarchy to parent categories? If a post has two categories how can I chose which category is used in the URL.

    As you say in your article, default is alphabetical.

    For example I have a post categorised „Fruit“ and „Vegetable“ with the permalink set to show /%category%/%postname%/.

    The URL shows website.com/Fruit/postname but I want it to use website.com/vegetable/postname.

    • WPBeginner Support says

      In those situations, you may want to look into how your categories are organized to see if tags may be what you need more than categories for some organizations. Normally posts shouldn’t be in multiple categories.

      Admin

    • Muhammad Kashif Rasheed says

      You answer is valuable for me, because I read all the post but not permalink not work fine on my side, when I applied your suggestion I got answer of my question.
      Once again thankyou very much,

  9. Sravankumar says

    I am unable to see subcategory in any posts.

    I am facing issue while creating a post name. How can Icreate a URL like this: site/destinations/europe/norway/post-name

    I have the page to create a URL like above is it only possible if I create a page or with post name also can we create?

    site/destinations/europe/norway/

    • WPBeginner Support says

      If I’m understanding the question correctly, you don’t need to create a page at the second link’s location as that would be your subcategory’s page listing the posts in that subcategory.

      Admin

  10. V says

    Adding /%category%/%postname%/ to the permalink structure breaks the pagination for some reason. Anyone else facing this?

    • WPBeginner Support says

      There are multiple possible reasons pagination could not be working, you may want to check with your specific theme’s support or reach out to us using our contact form for which would likely fix the issue.

      Admin

  11. jesica says

    How did you do to link your subcategory menu pages to a clean url: YOURSITE.COM/SUBCATEGORY? without the YOURSITE.COM/CATEGORY/SUBCATEGORY?
    I don’t know how to delete the parent category from the subcategory URL on my site…

    • WPBeginner Support says

      We don’t have a simple recommended method at the moment. If you want to remove reference to the parent category, should that category be a child category?

      Admin

  12. Shubham Dixit says

    I have an issue. I am using Custom Structure to display category name before the post name ( /%category%/%postname%/ ). It is working fine when I am logged in but after log out It doesn’t display category name in url.

    The above issue in in chorme browser. In firefox it is working fine.

    Please help!

  13. Ted says

    Yeah.. we all know this information.. you see %category% and it is obvious what it does. But Thanks….
    WHAT I WAS LOOKING FOR is code as in rewrite rules for my themes functions file..

  14. jcdarocha says

    Hi !
    Trick works well for a blog post / category.
    but what about woocommerce ? ay idea ?
    Even when you add this in permalink structure, WC show the main-category/product-name even if there 2 or 3 sub categories
    This is really annoying,
    Any idea?
    Thank you
    Jean-Charles

  15. Simon says

    This is great, but how would I go about having multiple URLs for the same post with multiple categories? So if I go from 1 category the URL is for that category and if I go from another it is that category?

    Thanks

  16. Jordan says

    Won’t this cause duplication problems? How do you make it so the parent category doesn’t open to an archive page?

    Like as an example – Main topic Music and then have a subcategory called popmusic…..

    Music ( Not Clickable )
    Pop Music ( Clickable and rediects to your posts associated with that sub categories)

    My issue with this is people clicking the parent categories and getting redirected to a page with no post associated with it because you don’t want to have duplicate content or a post in music & pop music

  17. Vale says

    Why Woocommerce do not support Subcaregories in permalinks?
    Google and other browsers recommed clean URL’s. And woocommerce Category slug can not be removed unless you pay $119 Usd for a plugin that does the trick.
    Is there another way to achieve these two issues?

  18. Jose says

    Thanks for this post. Its working for me. The only thing doesn`t work is when i try to list news by a subcategory

    Eg. mydomain.com/categorybase/subcategory/nameofnew/

    this works showing me the blog post, but if i want to list all posts of this subcategory like this

    mydomain.com/categorybase/subcategory/

    does’nt work.

    Any ideas how to fix it?

    Thanks in advance.

  19. Denish Callos says

    HI,
    I have added categories and tags in my pages. Now how do i add categories in pages permalink?
    Please suggestion will be highly appreciated.
    Thanks

  20. Kahil says

    This solution ONLY works if you select the subcategory in the post/page category list. If you have both the parent and the subcategories checked, then the parent category is the only one that shows. For those of us using Woocommerce, this messes with the related products. If you select just the subcategory, then you won’t see any related items from the parent category. If you select them both, then you’re back to dealing with not having the subcategory listed in your URL. Been looking for a simple solution to cover both needs.

    • Paul says

      Have you found a solution? We have the same exact problem right now. This is quite annoying and we don’t know what to do about it.
      Any ideas or solutions are appreciated!

  21. Giulia Sampogna says

    Hello,
    that´s a really nice post. I am wondering if I change it now will change my past one as well? If yes I would had to redirect all links right?

    Thanks a lot

  22. Dan says

    I’m confused and could use some help.

    Specifically, I am developing an ecommerce site that is composed of mostly PAGES. (NOT using woocommerce or another e-commerce platform, but building out my own gravity form for each product page).

    I want the product category to be in ALL my PAGE URL’s, but as you know, wordpress out of the box doesn’t enable assignment of categories and tags to PAGES (wish it did). One alternative would be to use one of the plugins I found that could enable this. The other is to simply use the product category name in the SLUG (part of the permalink I can create on the product page). I could also create a page for each product category and include a gallery showing each product item that belongs to that category with a link to its specific page, or, I could skip the product category page altogether and assign the „#“ in front of the category name when I create the menu, so that the category name would appear but not be an active link to any category page. I could get involved in creating a „custom post type“ for my product pages which would enable them to be assigned a category and tag, much like the woocommerce product „pages“ are setup (don’t know much about how to do that but would like to), etc.

    Also, the permalink settings effect URL’s for both pages and posts…correct ?

    REALLY appreciate a followup post from you that deep dives into helping people like me who are using wordpress for their ecommerce site but not using one of the out of the box ecommerce platforms.

    thankyou

Eine Antwort hinterlassen

Danke, dass du einen Kommentar hinterlassen möchtest. Bitte beachte, dass alle Kommentare nach unseren kommentarpolitik moderiert werden und deine E-Mail-Adresse NICHT veröffentlicht wird. Bitte verwende KEINE Schlüsselwörter im Namensfeld. Lass uns ein persönliches und sinnvolles Gespräch führen.