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

Come aggiungere categorie e sottocategorie in WordPress

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Volete sapere come creare categorie e sottocategorie in WordPress?

In WordPress, i post possono essere organizzati in diverse categorie e tag. È anche possibile creare sottocategorie per un’ulteriore organizzazione. L’uso di categorie e sottocategorie può aiutare i lettori a trovare i contenuti di maggiore interesse e migliorare il posizionamento SEO del sito.

In questo articolo vi mostreremo come aggiungere categorie e sottocategorie in WordPress, passo dopo passo.

Categories and subcategories in WordPress

Capire le categorie genitore e figlio in WordPress

Le categorie sono uno strumento potente. Non sono solo un modo per ordinare i contenuti. Aiutano anche a sviluppare una struttura del sito adeguata, significativa e semantica. Questo è ottimo per la SEO di WordPress.

Nota: se non vi è chiara la differenza tra categorie e tag, date un’occhiata alla nostra guida su categorie e tag. Questa spiega perché le categorie e i tag sono diversi e come usarli correttamente.

Ora vi starete chiedendo: perché e quando qualcuno dovrebbe avere bisogno di usare le categorie minori (sottocategorie) sul proprio sito web WordPress?

Supponiamo che stiate creando un blog di viaggi per diverse destinazioni nel mondo. Potreste volere che gli utenti siano in grado di trovare gli articoli sia per paese che per città.

Ad esempio, si potrebbe avere un articolo sui migliori parchi acquatici degli Stati Uniti. Avrebbe senso utilizzare “Stati Uniti” come categoria per quel post.

Tuttavia, potreste anche avere articoli sui migliori posti dove mangiare a New York, Los Angeles, Chicago e altri ancora. In questo caso è possibile utilizzare categorie o sottocategorie. In questo caso, “Stati Uniti” può diventare una categoria madre e le città possono diventare categorie figlie.

Category and subcategory in WordPress

Un post inserito in una categoria figlia non deve necessariamente essere inserito anche nella categoria madre. Nel nostro esempio, avremmo potuto lasciare la voce “Stati Uniti” non selezionata e inserire il post nella categoria “New York City”.

Se si archivia un post sotto la categoria figlia ma non sotto la categoria madre, il post apparirà solo nelle pagine di archivio della categoria figlia.

Detto questo, vediamo come aggiungere sia categorie normali che categorie figlio in WordPress.

Aggiungere una categoria in WordPress

È possibile aggiungere facilmente una nuova categoria in WordPress quando si scrive un post.

Innanzitutto, se la barra laterale non viene visualizzata quando si modifica un post, è necessario fare clic sull’icona dell’ingranaggio in alto a destra.

Quindi, nel pannello Post sul lato destro, aprite la scheda Categorie.

where to find categories when editing a post

Vedrete le diverse categorie che avete già creato.

Tuttavia, per creare una nuova categoria, è sufficiente fare clic sul link “Aggiungi nuova categoria”.

Adding a new category in WordPress

Una volta fatto clic sul link, appariranno due nuove caselle in cui aggiungere la categoria.

Per una categoria normale, non è necessario selezionare nulla dal menu a tendina della categoria padre.

Enter a category name and parent category

Una volta digitato il nome della categoria, è sufficiente fare clic sul pulsante “Aggiungi nuova categoria”.

La casella relativa a tale categoria verrà quindi selezionata automaticamente per il post corrente. Se lo si desidera, è possibile deselezionarla.

Preview of new category

È anche possibile aggiungere una nuova categoria senza modificare un post.

Basta andare su Post ” Categorie e aggiungere la nuova categoria. Questo è utile se si desidera creare tutte le categorie prima di aggiungere i contenuti.

Questo metodo consente anche di modificare lo slug (URL) delle categorie. È possibile eliminare e rinominare le categorie e dare loro una descrizione. Vedere come aggiungere parole chiave e descrizioni SEO in WordPress.

Add a new category

Aggiunta di una categoria figlia (sottocategoria) in WordPress

È possibile aggiungere e modificare le categorie figlio esattamente nello stesso modo in cui si sono aggiunte le categorie padre.

Quando si modifica un post, aprire il pannello delle impostazioni e scorrere fino alla scheda Categorie.

Quindi, fare clic sull’opzione “Aggiungi nuova categoria” e digitare il nome della categoria figlio. Quindi selezionare la categoria che si desidera utilizzare come genitore dall’elenco a discesa.

Add a subcategory

Allo stesso modo, è possibile andare su Post ” Categorie per aggiungere categorie secondarie.

È sufficiente digitare il nome della categoria figlia e selezionare la categoria madre dal menu a discesa.

Select a parent category

Le categorie figlio possono anche avere le proprie categorie figlio, se si vuole.

Ad esempio, si potrebbe decidere di sviluppare una struttura di categorie utilizzata per raggruppare più tipi di contenuti, come questa:

Preview of category structure

Qui, News è una categoria, con gli Annunci come categorie figlie.

Le categorie dello stesso livello all’interno di una categoria madre sono talvolta chiamate “fratelli”. Ad esempio, gli Annunci e gli Strumenti SEO sono categorie sorelle.

Le categorie possono avere un solo genitore. Non è possibile aggiungere una sottocategoria sotto due diverse categorie madri.

Vantaggi SEO della struttura del sito basata sulle categorie

Gli URL delle categorie avranno un aspetto simile a questo:

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

Questo è significativo e aiuta i motori di ricerca e i visitatori a capire di cosa tratta la vostra pagina. Inoltre, avete la possibilità di aggiungere parole chiave al vostro URL. Le parole chiave aiutano le persone a trovare i contenuti nei motori di ricerca.

WordPress consente anche di modificare facilmente il prefisso /category/ degli URL delle categorie. Se volete, potete anche rimuoverlo completamente.

Basta andare alla pagina Impostazioni ” Permalinks dal pannello di amministrazione di WordPress e scorrere verso il basso fino alla sezione “Base della categoria”.

Change category permalink settings

Qui è possibile inserire il prefisso che si desidera utilizzare e fare clic sul pulsante “Salva modifiche” per memorizzare le modifiche.

Il prefisso “categoria” negli URL delle categorie non apporta alcun beneficio alla SEO.

Per questo motivo, alcuni proprietari di siti web preferiscono rimuovere la parola “categoria” dagli URL delle pagine dell’archivio delle categorie di WordPress. È possibile farlo facilmente utilizzando il plugin All in One SEO, in modo che gli URL delle categorie abbiano questo aspetto:

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

Basta andare nel menu Aspetto di ricerca di AIOSEO e selezionare la scheda Tassonomie. Nelle impostazioni avanzate per le categorie, si vedrà l’opzione per rimuovere il prefisso di base della categoria.

AIOSEO Remove Category Base Prefix

In alternativa, è possibile utilizzare il plugin FV Top Level Categories. È sufficiente installare il plugin per rimuovere la parola “categoria” dagli URL delle pagine dell’archivio delle categorie.

Importante: se decidete di cambiare la base delle categorie su un sito WordPress esistente, dovrete impostare dei reindirizzamenti per evitare errori 404 per i visitatori dei motori di ricerca. Per istruzioni più dettagliate, seguite la nostra guida su come cambiare il prefisso di base delle categorie in WordPress.

Come visualizzare le categorie e le categorie figlio nella barra laterale di WordPress

È possibile aggiungere un blocco di widget alla barra laterale o al piè di pagina di WordPress per mostrare un elenco di categorie. Nella dashboard di WordPress, andate su Aspetto ” Widget.

Se non avete cambiato i vostri widget rispetto a quelli che WordPress inserisce di default, dovreste vedere il blocco widget Categorie già presente. In caso contrario, potete fare clic sul pulsante “+” e aggiungere un blocco “Categoria” alla vostra area widget.

Add a category widget block

Per impostazione predefinita, il widget mostra tutte le categorie in un elenco piatto, in ordine alfabetico.

Ecco un’anteprima del loro aspetto sul nostro sito web di prova:

Preview of categories in sidebar

Suggerimento: Le categorie vengono visualizzate nell’elenco solo se vi è stato assegnato almeno un post pubblicato.

Se si desidera, è possibile modificarlo in modo da mostrare le categorie figlie (sottocategorie) sotto le loro categorie madri. È sufficiente attivare l’opzione “Mostra gerarchia” nelle impostazioni del widget in questo modo. Non dimenticate di fare clic sul pulsante “Aggiorna”.

Show hierarchy in widget blocks

Sul vostro sito, dovreste ora vedere le vostre categorie madri con le categorie figlie annidate sotto di esse.

Suggerimento: se le modifiche alla barra laterale non vengono visualizzate, potrebbe essere necessario cancellare la cache di WordPress.

Oltre al blocco widget di categoria predefinito, è possibile creare collegamenti personalizzati al menu di categoria utilizzando il menu di navigazione di WordPress. Successivamente, è possibile aggiungere il menu al menu dell’intestazione, alla barra laterale, al piè di pagina o ad altre posizioni del menu.

Speriamo che questo tutorial vi abbia aiutato a capire come aggiungere categorie e categorie figlio in WordPress. Potreste anche dare un’occhiata al nostro articolo su come creare una newsletter via e-mail per aumentare il traffico del vostro sito web e al nostro confronto tra i migliori page builder di WordPress per creare layout personalizzati.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

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.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

99 commentiLascia una risposta

  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

      Admin

    • WPBeginner Support says

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

      Admin

      • 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.

      Admin

  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.

      Admin

  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.

      Admin

  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

      Admin

  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.

      Admin

  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 :)

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.