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

      Administrador

    • WPBeginner Support says

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

      Administrador

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

      Administrador

  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.

      Administrador

  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.

      Administrador

  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

      Administrador

  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.

      Administrador

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

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.