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

Como adicionar categorias e subcategorias no WordPress

Nota editorial: Ganhamos uma comissão de links de parceiros no WPBeginner. As comissões não afetam as opiniões ou avaliações de nossos editores. Saiba mais sobre Processo editorial.

Você quer saber como criar categorias e subcategorias no WordPress?

No WordPress, suas postagens podem ser organizadas em diferentes categorias e tags. Você pode até mesmo criar subcategorias para maior organização. O uso de categorias e subcategorias pode ajudar seus leitores a encontrar o conteúdo que mais lhes interessa e melhorar as classificações de SEO do seu site.

Neste artigo, mostraremos a você como adicionar categorias e subcategorias no WordPress, passo a passo.

Categories and subcategories in WordPress

Entendendo as categorias pai e filho no WordPress

As categorias são uma ferramenta poderosa. Elas não são apenas uma maneira de classificar seu conteúdo. Elas também ajudam você a desenvolver uma estrutura de site adequada que seja significativa e semântica. Isso é ótimo para o SEO do WordPress.

Observação: Se você não souber a diferença entre categorias e tags, dê uma olhada em nosso guia sobre categorias e tags. Ele explica por que as categorias e as tags são diferentes e como usá-las corretamente.

Agora você deve estar se perguntando: por que e quando alguém precisaria usar categorias secundárias (subcategorias) em seu site WordPress?

Digamos que você esteja criando um blog de viagens para diferentes destinos ao redor do mundo. Talvez você queira que os usuários possam encontrar artigos por país e cidade.

Por exemplo, você pode ter um artigo sobre os melhores parques aquáticos dos Estados Unidos. Faria sentido usar “Estados Unidos” como a categoria para essa postagem.

Entretanto, você também pode ter artigos sobre os melhores lugares para comer na cidade de Nova York, Los Angeles, Chicago e outros. É aqui que você pode usar subcategorias ou categorias secundárias. Então, “Estados Unidos” pode se tornar uma categoria principal e as cidades podem se tornar categorias secundárias.

Category and subcategory in WordPress

Uma postagem arquivada em uma categoria secundária não precisa ser arquivada também na categoria principal. Em nosso exemplo, poderíamos ter deixado a opção “United States” desmarcada e colocado a postagem na categoria “New York City”.

Se você arquivar uma postagem na categoria secundária, mas não na categoria principal, sua postagem aparecerá somente nas páginas de arquivo da categoria secundária.

Dito isso, vamos dar uma olhada em como adicionar categorias regulares e categorias secundárias no WordPress.

Como adicionar uma categoria no WordPress

Você pode adicionar facilmente uma nova categoria no WordPress ao escrever um post.

Primeiro, se a barra lateral não estiver sendo exibida quando você estiver editando uma publicação, será necessário clicar no ícone de engrenagem no canto superior direito.

Em seguida, no painel Post no lado direito, abra a guia Categories (Categorias).

where to find categories when editing a post

Você verá diferentes categorias que já criou.

No entanto, para criar uma nova categoria, você pode simplesmente clicar no link “Add New Category” (Adicionar nova categoria).

Adding a new category in WordPress

Depois de clicar no link, serão exibidas duas novas caixas nas quais você poderá adicionar sua categoria.

Para uma categoria normal, você não precisa selecionar nada no menu suspenso Parent Category (Categoria pai).

Enter a category name and parent category

Depois de digitar o nome da sua categoria, basta clicar no botão “Add New Category” (Adicionar nova categoria).

A caixa dessa categoria será automaticamente marcada para sua postagem atual. Você pode desmarcá-la, se desejar.

Preview of new category

Você também pode adicionar uma nova categoria sem editar uma postagem.

Basta acessar Posts ” Categories e adicionar sua nova categoria. Isso é útil se você quiser criar todas as suas categorias antes de adicionar conteúdo.

Esse método também permite que você edite o slug (URL) das suas categorias. Você pode excluir e renomear categorias e dar a elas uma descrição. Veja como adicionar palavras-chave e descrições de SEO no WordPress.

Add a new category

Adição de uma categoria secundária (subcategoria) no WordPress

Você pode adicionar e editar categorias secundárias exatamente da mesma forma que adicionou as categorias principais.

Quando estiver editando uma postagem, abra o painel de configurações e role para baixo até a guia Categories (Categorias).

Em seguida, clique na opção “Add New Category” (Adicionar nova categoria) e digite o nome de sua categoria secundária. Em seguida, selecione a categoria que você deseja usar como a principal na lista suspensa.

Add a subcategory

Da mesma forma, você também pode ir para Posts ” Categories para adicionar categorias secundárias.

Basta digitar o nome de sua categoria secundária e selecionar a categoria principal no menu suspenso.

Select a parent category

Suas categorias secundárias também podem ter suas próprias categorias secundárias, se você desejar.

Por exemplo, podemos decidir desenvolver uma estrutura de categoria que seja usada para agrupar vários tipos de conteúdo, como esta:

Preview of category structure

Aqui, Notícias é uma categoria, com os Anúncios como categorias secundárias.

As categorias no mesmo nível dentro de uma categoria principal às vezes são chamadas de categorias “irmãs”. Por exemplo, os Anúncios e as Ferramentas de SEO são categorias irmãs aqui.

As categorias só podem ter uma categoria principal. Não é possível adicionar uma subcategoria em duas categorias principais diferentes.

Benefícios de SEO da estrutura do site baseada em categorias

Os URLs de sua categoria terão a seguinte aparência:

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

Isso é significativo e ajuda os mecanismos de pesquisa e os visitantes a entenderem do que se trata a sua página. Você também tem a chance de adicionar palavras-chave ao seu URL. As palavras-chave ajudam as pessoas a encontrar conteúdo nos mecanismos de busca.

O WordPress também permite que você altere facilmente o prefixo /category/ dos URLs de suas categorias. Você pode até mesmo removê-lo completamente, se desejar.

Basta acessar a página Configurações ” Permalinks no painel de administração do WordPress e rolar para baixo até a seção “Base da categoria”.

Change category permalink settings

Aqui você pode inserir o prefixo que deseja usar e clicar no botão “Save Changes” (Salvar alterações) para armazenar as alterações.

O prefixo “category” em seus URLs de categoria não acrescenta nenhum benefício ao seu SEO.

É por isso que alguns proprietários de sites preferem remover a palavra “categoria” dos URLs de suas páginas de arquivo de categoria do WordPress. Você pode fazer isso facilmente usando o plug-in All in One SEO, para que os URLs de suas categorias tenham a seguinte aparência:

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

Basta acessar o menu Search Appearance do AIOSEO e selecionar a guia Taxonomies (Taxonomias). Nas configurações avançadas de Categorias, você verá a opção de remover o prefixo da base da categoria.

AIOSEO Remove Category Base Prefix

Como alternativa, você também pode usar o plug-in FV Top Level Categories. Basta instalar o plug-in e ele removerá a palavra “categoria” dos URLs de suas páginas de arquivo de categoria.

Importante: se você decidir alterar a base da categoria em um site existente do WordPress, precisará configurar redirecionamentos para evitar erros 404 para os visitantes do mecanismo de pesquisa. Para obter instruções mais detalhadas, siga nosso guia sobre como alterar o prefixo da base da categoria no WordPress.

Como exibir categorias e categorias secundárias na barra lateral do WordPress

Você pode adicionar um bloco de widget à barra lateral ou ao rodapé do WordPress para mostrar uma lista de categorias. No painel do WordPress, vá para Appearance ” Widgets.

Se você não tiver alterado seus widgets em relação aos que o WordPress coloca por padrão, deverá ver o bloco de widget Categorias já instalado. Caso contrário, você pode clicar no botão “+” e adicionar um bloco “Categoria” à sua área de widgets.

Add a category widget block

Por padrão, o widget mostrará todas as suas categorias em uma lista simples, em ordem alfabética.

Aqui está uma prévia de como eles ficaram em nosso site de teste:

Preview of categories in sidebar

Dica: As categorias só serão exibidas na lista se você tiver atribuído pelo menos um post publicado a elas.

Você pode alterá-lo para mostrar as categorias secundárias (subcategorias) abaixo de suas categorias principais, se desejar. Basta ativar a opção “Mostrar hierarquia” nas configurações do widget desta forma. Não se esqueça de clicar no botão “Atualizar”.

Show hierarchy in widget blocks

Em seu site, agora você deve ver as categorias principais com as categorias secundárias aninhadas abaixo delas.

Dica: se as alterações na barra lateral não forem exibidas, talvez seja necessário limpar o cache do WordPress.

Além do bloco de widget de categoria padrão, você também pode criar links de menu de categoria personalizados usando o menu de navegação do WordPress. Depois disso, você pode adicionar esse menu ao menu do cabeçalho, à barra lateral, ao rodapé ou a outros locais de menu.

Esperamos que este tutorial tenha ajudado você a aprender como adicionar categorias e categorias secundárias no WordPress. Talvez você também queira dar uma olhada em nosso artigo sobre como criar um boletim informativo por e-mail para aumentar o tráfego do seu site e em nossa comparação dos melhores construtores de páginas do WordPress para criar layouts personalizados.

Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.

Divulgação: Nosso conteúdo é apoiado pelo leitor. Isso significa que, se você clicar em alguns de nossos links, poderemos receber uma comissão. Veja como o WPBeginner é financiado, por que isso é importante e como você pode nos apoiar. Aqui está nosso processo editorial.

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.

O kit de ferramentas definitivo WordPress

Obtenha acesso GRATUITO ao nosso kit de ferramentas - uma coleção de produtos e recursos relacionados ao WordPress que todo profissional deve ter!

Reader Interactions

99 ComentáriosDeixe uma resposta

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

      Administrador

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

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

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

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

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

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

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

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

      Administrador

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

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

  13. 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?

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

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

  16. 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?

  17. 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!

  18. 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?

  19. 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?

  20. 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…..

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

  22. 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!

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

  24. 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?

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

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

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

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

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

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

  31. WPBeginner Staff says

    Yes, we do understand what you mean :)

    Many WordPress themes actually come with built-in support to display sub-menus under menus.

    Go to Appearance -> Menus and add a subcategory just below its parent category. drag the subcategory to your right it will appear a little idented under the parent category. Save your menu and preview your site.

    On the front end if your subcategory does not appear in a sub menu but instead appears slightly indented below the parent category, then it is likely that your theme does not handle the display of submenus like you want.

    There are plenty of WooCommerce themes which support submenus you can check out their demos until you find the one that displays product categories in menus like you want.

  32. mreshane says

    i have issues over subcategories to product categories, i want to make this a careful question and hoping to get a understandable answered
    (im not so good in english, correct me if im wrong – Thank you)

    I have a site but im using a woocommerce, im not sure whether this is the right topic or not but heregoes.

    Let say i have this 1 categories such like,

    1. windows (categories)
    1.1 xp
    1.2 windows 7
    1.3 windows 8 (but this one i rather want it to be in a different product categories such like)

    1.3 windows8
    1.3.1 Laptop
    1.3.2 Windows Tab

    but in 1 categories (WINDOWS), can i do that? i mean like geez im sorry if you didn’t get it, but that’s my point here.. i really want my categories in 1 menu to be in different subs & products..

    Is there any easy way to do this?

    im so lost..

    Sorry for my bad english..

    i already attached the picture, please do reply or email me mreshane[at]gmail[dot]com

    Thank you.

  33. Derek says

    Hi just wondering your advice for bulk uploading of categories via cvs file. I want have computer brands as categories but thinking there has to be a quicker way than doing individually?

  34. mc says

    Is it possible for a sub-category to apply to more than one parent? I.e. if the top level categories are Pizza and Calzones, ‘pepperoni’ can be a sub-category of both…but I don’t see how to handle that. Should ‘pepperoni’ be a tag instead?

  35. Sue says

    We have a store site and used the tutorial to create a new category. In the admin functions it shows up in the lists. However the new category does not show up on the actual site. What am I missing?

  36. Anna says

    I’m startineg a blog and have created a Category and Sub-Category but the sub-category is not indented or anything to make it obvious it’s a sub-category, just doesn’t look right. Any advice?

  37. James says

    But why? You say over and over again “to keep your blog organised” Where and to who are you organising it?

    Does it create category pages and if so do we really want them? can we control how they look ? Can we disable category pages?

      • Your Real Name says

        Hi,. Can any one tell me how can i add sub-categories of a category in Navigation tab to display them once they click on specific category ? I am using Arras …
        In this tutorial, we’ll show you how to add sub-categories to your newly created top menu category. (In our case Help). 2. First, go to …
        How to Add Categories to a WordPress Blog Site. Categories for your WordPress blog are not as easily found as they might be. You could … Add sub-categories.

  38. Trish says

    This is very helpful! THANK YOU! OK, so if I have a Fitness blog and I want a category at the top to be “strength workouts” and then I want the user to be able to highlight “strength workouts” and see a list of the exact strength workouts I have to share/offer, is that called a subcategory? What if I want like 15 of these sample strength workouts… or eventually 100’s of them… ? Is this how I’d go about it? Thank you!!!

    • Editorial Staff says

      Ok, so think of categories as sections in a book and sub-categories to be chapters. A proper example would be like this:

      Parent category is called Entertainment, and sub-categories would be Film, Gaming, Music, Television etc.

      In your case you would have strength workouts as category, and then have each individual strength workout as a post. From what it sounds like, you don’t need subcategories at all.

      Administrador

      • Trish says

        OK, thanks. My blog will have recipes, workouts, a fashion section, etc. so I would like the reader to be able to go to one of those categories then pick a workout under the workout section, a recipe under “recipes — breakfast recipes — ” and so on… so if those are not called subcategories, than what are they? Like on peanutbutterfingers.com website – the website has categories such as “workouts” and then if you highlight over “workouts” you’ll see where you can pick a type of workout, go into that and then select a specific workout… how did she get it set up like that? Do I have those capabilities using wordpress? Thank you so much! Sorry, I’m kind of lost and new to this portion of it :)

Deixe uma resposta

Obrigado por deixar um comentário. Lembre-se de que todos os comentários são moderados de acordo com nossos política de comentários, e seu endereço de e-mail NÃO será publicado. NÃO use palavras-chave no campo do nome. Vamos ter uma conversa pessoal e significativa.