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

Comment ajouter des catégories et des sous-catégories dans WordPress

Note éditoriale : Nous percevons une commission sur les liens des partenaires sur WPBeginner. Les commissions n'affectent pas les opinions ou les évaluations de nos rédacteurs. En savoir plus sur Processus éditorial.

Voulez-vous savoir comment créer des catégories et des sous-catégories dans WordPress ?

Dans WordPress, vos publications peuvent être organisées en différentes catégories et identifications. Vous pouvez même créer des sous-catégories pour une meilleure organisation. L’utilisation de catégories et de sous-catégories peut aider vos lecteurs à trouver le contenu qui les intéresse le plus et améliorer le classement de votre site en matière de référencement.

Dans cet article, nous allons vous afficher comment ajouter des catégories et des sous-catégories dans WordPress, étape par étape.

Categories and subcategories in WordPress

Comprendre les catégories parents et enfants dans WordPress

Les catégories sont un outil puissant. Elles ne sont pas seulement un moyen de trier votre contenu. Elles vous aident également à développer une structure de site appropriée qui est significative et sémantique. C’est excellent pour le référencement de WordPress.

Note : Si vous ne comprenez pas bien la différence entre les catégories et les identifiants, consultez notre guide sur les catégories et les identifiants. Il explique pourquoi les catégories et les identifiants sont différents et comment les utiliser correctement.

Vous vous demandez peut-être pourquoi et quand quelqu’un devrait utiliser des catégories enfant (sous-catégories) sur son site WordPress?

Imaginons que vous créiez un blog de voyage pour différentes destinations dans le monde. Vous souhaitez que les utilisateurs/utilisatrices puissent trouver des articles par pays et par ville.

Par exemple, vous pouvez rédiger un article sur les meilleurs parcs aquatiques des États-Unis. Il serait logique d’utiliser « États-Unis » comme catégorie pour cette publication.

Cependant, vous pourriez aussi avoir des articles sur les meilleurs endroits où manger à New York, Los Angeles, Chicago, etc. C’est là que vous pouvez utiliser des catégories enfants ou des sous-catégories. Ainsi, « États-Unis » peut devenir une catégorie mère et les villes peuvent devenir des catégories enfants.

Category and subcategory in WordPress

Une publication classée dans une catégorie enfant n’a pas besoin d’être également classée dans la catégorie parent. Dans notre exemple, nous aurions pu ne pas cocher la case « États-Unis » et placer la publication dans la catégorie « Ville de New York ».

Si vous déposez une publication dans la catégorie enfant mais pas dans la catégorie parent, votre publication apparaîtra uniquement sur les pages d’archives de la catégorie enfant.

Cela dit, voyons comment ajouter à la fois des catégories ordinaires et des catégories enfants dans WordPress.

Ajout d’une catégorie dans WordPress

Vous pouvez facilement ajouter une nouvelle catégorie dans WordPress lors de la rédaction d’une publication.

Tout d’abord, si la colonne latérale ne s’affiche pas lorsque vous modifiez une publication, vous devez cliquer sur l’icône en forme de roue dentée en haut à droite.

Ensuite, dans le panneau des publications sur le côté droit, ouvrez l’onglet Catégories.

where to find categories when editing a post

Vous verrez différentes catégories que vous avez déjà créées.

Toutefois, pour créer une nouvelle catégorie, il vous suffit de cliquer sur le lien « Ajouter une nouvelle catégorie ».

Adding a new category in WordPress

Une fois que vous aurez cliqué sur le lien, deux nouvelles boîtes apparaîtront, dans lesquelles vous pourrez ajouter votre catégorie.

Pour une catégorie ordinaire, vous n’avez pas besoin de sélectionner quoi que ce soit dans la liste déroulante Catégorie parentale.

Enter a category name and parent category

Une fois que vous avez saisi le nom de votre catégorie, il vous suffit de cliquer sur le bouton « Ajouter une nouvelle catégorie ».

La case correspondant à cette catégorie sera alors automatiquement cochée pour votre publication actuelle. Vous pouvez la décocher si vous le souhaitez.

Preview of new category

Vous pouvez également ajouter une nouvelle catégorie sans modifier une publication.

Il vous suffit d’aller dans la rubrique  » Publications  » Catégories et d’ajouter votre nouvelle catégorie. C’est pratique si vous souhaitez créer toutes vos catégories avant d’ajouter du contenu.

Cette méthode vous permet également de modifier le slug (URL) de vos catégories. Vous pouvez supprimer et renommer des catégories et leur donner une description. Voir comment ajouter des mots-clés SEO et des descriptions dans WordPress.

Add a new category

Ajout d’une catégorie enfant (sous-catégorie) dans WordPress

Vous pouvez ajouter et modifier des catégories enfants exactement de la même manière que vous avez ajouté vos catégories parents.

Lorsque vous modifiez une publication, ouvrez le panneau des Réglages et défilez vers le bas jusqu’à l’onglet Catégories.

Cliquez ensuite sur l’option « Ajouter une nouvelle catégorie » et saisissez le nom de votre catégorie enfant. Sélectionnez ensuite la catégorie que vous souhaitez utiliser comme parent dans la liste déroulante.

Add a subcategory

De la même manière, vous pouvez également vous rendre dans  » Publications  » Catégories pour ajouter des catégories enfants.

Il vous suffit de saisir le nom de votre catégorie enfant et de sélectionner la catégorie parent dans le menu déroulant.

Select a parent category

Vos catégories enfant peuvent également avoir leurs propres catégories enfant si vous le souhaitez.

Par exemple, nous pourrions décider de développer une structure de catégories utilisée pour regrouper plusieurs types de contenu, comme ceci :

Preview of category structure

Ici, les Nouvelles sont une catégorie, avec les Annonces comme catégories enfantines.

Les catégories de même niveau au sein d’une catégorie parente sont parfois appelées catégories « sibling ». Par exemple, les catégories Annonces et Outils de référencement sont des catégories apparentées.

Les catégories peuvent uniquement avoir un parent. Vous ne pouvez pas ajouter une sous-catégorie sous deux catégories parentes différentes.

Avantages de la structure de site basée sur les catégories pour le référencement

Les URL de vos catégories ressembleront à ceci :

https://example.com/category/united-states/new-york-city/

Cela a un sens et aide les moteurs de recherche et les internautes à comprendre le contenu de votre page. Vous avez également la possibilité d’ajouter des mots-clés à votre URL. Les mots-clés aident les internautes à trouver du contenu dans les moteurs de recherche.

WordPress vous permet également de modifier facilement le préfixe /category/ des URL de vos catégories. Vous pouvez même le retirer complètement si vous le souhaitez.

Il suffit de se rendre sur la page Réglages  » Permaliens du panneau d’administration de WordPress et de défiler jusqu’à la section  » Base de catégorie « .

Change category permalink settings

Vous pouvez saisir le préfixe que vous souhaitez utiliser et cliquer sur le bouton « Enregistrer les modifications » pour stocker vos modifications.

Le préfixe « catégorie » dans les URL de vos catégories n’apporte aucun avantage à votre référencement.

C’est pourquoi certains propriétaires de sites préfèrent retirer le retirer le mot  » catégorie  » des URL de leurs pages d’archives de catégories WordPress. Vous pouvez facilement le faire en utilisant l’extension All in One SEO, de sorte que vos URL de catégories ressemblent à ceci :

http://example.com/united-states/new-york-city/

Il vous suffit de vous rendre dans le menu Apparence de la recherche pour AIOSEO, puis de sélectionner l’onglet Taxonomies. Sous les réglages avancés pour les Réglages, vous verrez l’option de supprimer le préfixe de base de la catégorie.

AIOSEO Remove Category Base Prefix

Vous pouvez également utiliser l’extension FV Top Level Categories. Il suffit d’installer cette extension pour retirer le mot « catégorie » des URL de vos pages d’archives de catégories.

Important : Si vous décidez de modifier la base de catégorie sur un site WordPress existant, alors vous devrez définir des redirections pour éviter les erreurs 404 pour les internautes dans les moteurs de recherche. Pour des instructions plus détaillées, Veuillez suivre notre guide sur la modification du préfixe de la base de catégorie dans WordPress.

Comment afficher les catégories et les catégories enfants dans la colonne latérale de WordPress

Vous pouvez ajouter un bloc de widgets à votre colonne latérale ou à votre pied de page WordPress pour afficher une liste de catégories. Dans votre Tableau de bord WordPress, allez dans Apparence  » Widgets.

Si vous n’avez pas modifié vos widgets par rapport à ceux que WordPress place par défaut, vous devriez voir le bloc de widgets Catégories déjà en place. Si ce n’est pas le cas, vous pouvez cliquer sur le bouton « + » et ajouter un bloc « Catégorie » à votre zone de widgets.

Add a category widget block

Par défaut, le widget affiche toutes vos catégories dans une liste plate, par ordre alphabétique.

Voici une Prévisualisation de leur aspect sur notre site de test :

Preview of categories in sidebar

Astuce : Les catégories s’affichent uniquement dans la liste si vous leur avez assigné au moins une publication.

Vous pouvez le modifier pour afficher les catégories enfants (sous-catégories) sous leurs catégories parents si vous le souhaitez. Il vous suffit d’activer l’option « Afficher la hiérarchie » dans les Réglages du widget comme ceci. N’oubliez pas de cliquer sur le bouton « Mettre à jour ».

Show hierarchy in widget blocks

Sur votre site, vous devriez maintenant voir vos catégories parents avec les catégories enfants imbriquées en dessous.

Astuce : Si les modifications apportées à la colonne latérale ne s’affichent pas, il se peut que vous deviez vider le cache de WordPress.

Outre le bloc de widgets de catégorie par défaut, vous pouvez également créer des liens de menu de catégorie personnalisés à l’aide du menu de navigation de WordPress. Après cela, vous pouvez ajouter ce menu à votre menu d’en-tête, à la colonne latérale, au pied de page ou à d’autres emplacements de menu.

Nous espérons que ce tutoriel vous a aidé à apprendre comment ajouter des catégories et des catégories enfants sur WordPress. Vous pouvez également consulter notre article sur la création d’une newsletter par e-mail pour augmenter le trafic de votre site, et notre comparatif des meilleurs constructeurs de pages WordPress pour créer des mises en page personnalisées.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Divulgation : Notre contenu est soutenu par les lecteurs. Cela signifie que si vous cliquez sur certains de nos liens, nous pouvons gagner une commission. Consultez comment WPBeginner est financé, pourquoi cela compte et comment vous pouvez nous soutenir. Voici notre processus éditorial.

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.

L'ultime WordPress Toolkit

Accédez GRATUITEMENT à notre boîte à outils - une collection de produits et de ressources liés à WordPress que tous les professionnels devraient avoir !

Reader Interactions

99 commentairesLaisser une réponse

  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. Atul Tanna says

    I have a Buying Guide, Review, and Categories and Under Categories I have several sub categories
    When I Review Amazon Products I would like them to appear under Reviews and at te same time time I would like them to appear in one of the sub categories How do I get started and what do I do

    Thanks

  3. Alaba says

    Hi, my site has some categories that don’t have any parent category. However, these were created a long time ago. Can I just assign them one?

    • WPBeginner Support says

      You can but if you have any posts under the categories, be sure to redirect any posts that had their URLs changed

      Administrateur

    • WPBeginner Support says

      If you mean when adding a post to the category, you would only need to check the child category

      Administrateur

      • Imran khan says

        I have my permalink structure set to “/%category%/%postname%/” and I want to show the parent category in my URL.
        1. If I checked the child category my post URL’s are showing: “www.my-site.com/parent-cat/child-cat/post-name/”
        2. If I checked both child and parent categories, my post URL’s are showing: “www.my-site.com/parent-cat/post-name/” that I want. So now should I check the parent category also checked, or keep it unchecked? If i checked both then it would not be an issue to have duplicate content that will negatively affect on SEO.

  4. Sade says

    Hi,

    I have made my catergory showing at the top a drop down, but when I put category in my primary sidebar when I click it says ‘select category’ and doesn’t show my sub categories. How do I fix this?

    Thanks

    • WPBeginner Support says

      You would normally need to manually add subcategories if we’re understanding what you’d want correctly.

      Administrateur

  5. Ebi says

    Hi
    Can I generate multiple articles for the main category without selecting a subcategory for it (with a few subcategories), is this SEO desirable?

    • WPBeginner Support says

      You can have multiple posts in one category if you wanted and not use subcategories, it would depend on the overall organization of your site for how useful it would be and if it would have any SEO effect.

      Administrateur

  6. Candy says

    I have six categories on my homepage. When you click the image on the homepage, it takes you to that category page. I am having an issue with blog posts. How do I get the blog post to automatically appear on the correct category page? I’m been doing this manually and I know there has to be another way. Thanks in advance!

    • WPBeginner Support says

      You should be able to link to the category page for WordPress to automatically list the posts in a category. You can get the link to your category page by adding a category to your menu. You should not be manually creating your category pages.

      Administrateur

  7. Stef says

    You mentioned if you don’t attach the item to the parent and only the child that it wouldn’t show up in the parent. This is incase you don’t want duplicate content.

    If left attached to both would this create an SEO issue of having duplicate content then? I know Google frowns upon duplicate content, but you didn’t say.

    Thanks in advance.

  8. Julie says

    Thanks,
    I was told I was creating my categories incorrectly as they had the word ‘category’ in the URL. I read several posts on how to create categories and yours was the only one explaining this.
    That said, how bad is it to have this? I hate to add in yet another plugin. It really doesn’t bother me…unless it should for some reason.
    Julie

  9. Anna Tang says

    Thank you for the tutorial. It was clearly written and I solved my category/subcategory issues within 5 minutes.
    Best,
    Anna

    • WPBeginner Support says

      You can change which category is the default under Settings>Writing but you must have at least one default category

      Administrateur

  10. Michael Taylor says

    Is it possible to create a hierarchy with lets say parent, child, grandchild , and great grandchild? in other words…

    United States > California > San Francisco > Hotels
    United States > Nevada > Las Vegas > Hotels
    United States > New York > New York City > Hotels
    Canada > British Columbia > Vancouver > Resturantrs

  11. dinesh says

    How can I represent woocommerce categories, subcategories, and products in the form:
    1) A form consists of 3 fields categories, subcategories, and products
    2)If we select one category the related subcategories should be displayed in subcategories feild.
    3)Select Subcategory , such that the product should be displayed by related categories and subcategories
    4) And if we submit the form It should redirect to checkout page

  12. sera says

    Hi
    i have a problem
    i want to associate one subcategory to a few parents
    for example:

    outdoor > panel
    indoor > panel

    outdoor & indoor is parents and panel is a child

    can you help me please??
    thaks a lot

    • Usama Ahmed says

      That is the most basic example of many to many relationship inside categories. One Category with multiple parents.

      Unfortunately WordPress is a pile of garbage and till this date this feature is not available.

  13. Sunshine Vaughn says

    I don’t want all of my posts to show when i click on the parent. How do i go about fixing this?
    I only want to see the posts directly placed in each category and then list out each sub category just like you would in using Windows Explorer.
    Thank you,
    Sunshine

  14. Mike says

    I’m helping a friend switch update their website, and upon investigation they built it mainly from categories and sub-categories, with only four (unfinished and unlinked) pages and the reading setting as show recent posts, instead of having a static homepage. The main menu displays categories with sub categories highlighted underneath.

    My question is, what’s the best way to update the site, by adding a static homepage and other primary pages for the posts to be listed with without messing with the overall organization of the content?

  15. Bel says

    Hello, awesome site. Thank you you have helped me to build my website.
    I have question hoping you can help – is there an plugin to place small images left side of post summaries on landing page.? I have looked and searched and even paid for a plugin that did not operate. Any help would be great.

  16. Steven Denger says

    Very helpful like all your tutorials are. I always come here to learn the best practices as well as great plugin resources. Thanks for this tutorial.

  17. Stefan says

    So… what is a sub-category good for?
    :)
    I can just have « United States » and « New York » — both as categories, and simply drag « New York » under « United States ». They’ll be displayed the same, as category / subcategory, only that they’re both categories.

    I can choose if an article goes to both, or just one of the categories.

    So, what is the use of having a subcategory?

    • WPBeginner Support says

      Hey Stefan,

      Subcategories allow you to add subtopics to a category. An article, filed in a sub-category is also displayed in the parent category. However, an article filed in a sibling category will not be displayed on other sub-categories that are also part of the same parent category.

      Administrateur

  18. Vijeesh Vijay says

    Duplicate content is the major issue when assigning posts to both parent categories and child categories. For example, I want the same post to show up under « united states » parent category and « New York » child category. However I need more than 1 post in each child category to avoid duplicate content.
    The problem occurs when you have a menu or website navigation made of categories. You have to wait until the blog is big enough to have a few articles in each sub categories to make a proper menu. Is there a way around this ?

    • Anja says

      Hi VIJEESH,

      It shouldn’t be a problem. The url of the page/post remains the same, it is mentioned in the category page and Google recognizes this, their bots are really intelligent :-) To avoid it even better I suggest you install YOAST SEO, a free plugin, which is great for your SEO and they offer the option to avoid duplicate content from categories as well in the settings menu.

      Hope this helps!
      Anja

  19. rose says

    hi guys!

    I’ve been working on my website and for days I’m trying to figure out on how to work the sub menus on my two blog categories namely lifestyle and tv series- the 1st submenu is working out fine but the 2nd level up to fourth level- I can’t click it al all.

    i’ve tried plugins and all

    is there anyone can help me with this please? Thanks so much

    sincerely,
    rose

  20. Jill says

    Great article. This was a HUGE help!

    Question:
    You explained how to get the child categories to show on the blog sidebar but how do I get them to show on the top bar as drop downs?

  21. vivek says

    To do this go to Posts -> All Posts. Next, select the posts you want to add to a category, click on the Bulk Actions tab, select Edit and finally press the Apply button. Once you do that, you will few options you can adjust for those posts. One of them is the Categories section.

  22. Harish Negi says

    I am using category and subcategory, but they are not reflecting in my URL. is there any reason for that in wordpress. Please answer..

  23. evan says

    I would like my category pages to show the sub-category PAGES that belong to that post. Currently, my category pages are show the subcategory POSTS.

    How do I fix this?

  24. Alex says

    Great read, thanks!

    I am creating a website with the exact same example you gave. I am wondering if it’s better to have the permalink structure set to:
    1. /continent/country/destination/%postname% or to
    2. /%postname%
    I am not sure if the first option is better, since it is becoming quite long.

    Thank you for your help!

  25. Urooj says

    Thank you for this post. I understand the category and the sub categories you explained. There si something I want for the my website. I make a category for a course with the course name now for the sub-categories, say, I want books, audios, videos and flashcards also I want a page which shows all the books from all the categories I have on a single page. Same for the audios, videos and flashcards. Is that possible without duplication?

  26. Jason says

    Is it possible to have multiple subcategories with the same name? For example, to categorize counties in the United States as State -> County. I would like Mississippi -> Jackson but also Alabama -> Jackson. Jackson county exists in both states, but should be entirely unrelated. Any way to accomplish this?

  27. Rolfa Stol says

    I add category per easy instructions above ( visit POSTS–add new category..) and the added show up to the right, correctly as far as i can see, but not on main page under categories. Impossible to get it there, only the default « uncategorixed » show up there. Really strange, as i need to use Kudani and make a post on distance, but it also seems to think i have no category…..

  28. Suzy says

    Dear staff,

    What if I want to display my 2 subcategories on their parent category page?

    I know that there is some sort of code, but where exactly should I paste this code, in the functions.php?

    Thank you

  29. Ian Anderson says

    Hiya, thanks for the tutorial.

    Any tips where categories overlap? For example my DIY site often features stuff made from wood but also repairing or maintaining stuff made from wood. Do I categorize ‘wood’ or ‘repair’ / ‘maintain’.

    Plus different materials (metal/tile/fabric etc) so I’m really struggling to know what to put first, material or action?! Either way it looks like I’m going to have duplicate subcategories…
    Sometimes wish I had a needle narrow skillset lol!

  30. Kaye says

    Is there a limit on categories? I currently have 10 displayed but have 12 listed so two is not showing up. Is there a way to add more so that the last two will show up. When going to my site live I see the two space on the third row but they are not showing up. What am I doing wrong

  31. Elliot says

    Is there a limit to the amount of categories enabled on word press?

    I have a large amount of subcategories and wordpress won’t allow me to add anymore, it seems to just boot an old category out in order to make space for the new one?

    Can anybody help?

  32. Rahul Choudhary says

    Hi Syed

    Thanks for this article. The example you have given here is exactly the same scenario i am dealing with. Now here is situation I have Categories

    Parent Category : Australia
    Child Category: NSW
    Child Child Category : Sydney

    I also have three more Parent categories at same level as Australia

    Apple
    Microsoft
    Other

    Now when I create a post I assign Parent & child categories because I am using ajax search to filter the result on hierarchy based. I also select one of those parent categories as well : Apple, Microsoft or Other.

    Now I have a search box where I sort the result based on country city or town. I would like to have a one more search box where I could sort based on Apple, Microsoft or others where once I select apple then it should display Australia -> NSW -> Sydney.

    Its like country (parent) category will be a child category in this search.

    Is this possible?

    Thanks
    Rahul

  33. francis okoye says

    Thanks for d tutorials was really helpful. How can I make my subcategory to appear when the mouse is hovered on the category. I don’t want the subcategory to show beneath the category. I want it to show on hovering the category…. Any help please

  34. Rahul says

    Hi

    I am having real problem sorthing this category issue. I want to display hotels & Car Rental in various countries so:

    Country
    -> US -> Alabama -> Montgomery
    -> Australia -> NSW -> Sydney

    Country is the ultimate parent category I would like to have.

    Then I would like to display either all the hotels or Car Rental in that particular city.

    So basically countries will have both hotels and car rentals but I would like to display hotels only in Sydney if user decided to display hotels only or car rental.

    Help Needed.

    Cheers

  35. claude apetse says

    hello admin , i found very interesting post in your tag. but in my , the first day after hosting the site (wordpress) i added some category but after a while ( some days after) i could no longer add new category . it is adding of course in the category form when i fill it but not showing in the homepage of the site

  36. Chris says

    Are the categories you mention in this post only applicable to POSTS, or can categories be added for PAGES as well? I don’t see an option for creating a category for PAGES.

  37. sandeep Kumar Dan says

    Hi, Sayed

    Great article , its really helpful , I was doing an product listing project . Where i was need many category subcategory option , finally I did it with this tutorial. Thanks a lot :)

Laisser une réponse

Merci d'avoir choisi de laisser un commentaire. Veuillez garder à l'esprit que tous les commentaires sont modérés selon notre politique de commentaires, et votre adresse e-mail ne sera PAS publiée. Veuillez NE PAS utiliser de mots-clés dans le champ du nom. Ayons une conversation personnelle et significative.