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

Cómo añadir categorías y subcategorías en WordPress

Nota editorial: Ganamos una comisión de los enlaces de socios en WPBeginner. Las comisiones no afectan a las opiniones o evaluaciones de nuestros editores. Más información sobre Proceso editorial.

¿Quieres saber cómo crear categorías y subcategorías en WordPress?

En WordPress, tus entradas se pueden organizar en diferentes categorías y etiquetas. Incluso puedes crear subcategorías para una mayor organización. El uso de categorías y subcategorías puede ayudar a tus lectores a encontrar el contenido que más les interesa y mejorar el posicionamiento SEO de tu sitio web.

En este artículo, le mostraremos cómo añadir categorías y subcategorías en WordPress, paso a paso.

Categories and subcategories in WordPress

Categorías padre e hijo en WordPress

Las categorías son una potente herramienta. No son sólo una forma de clasificar su contenido. También le ayudan a desarrollar una estructura de sitio adecuada que sea significativa y semántica. Esto es genial para su WordPress SEO.

Nota: Si no tiene clara la diferencia entre categorías y etiquetas, consulte nuestra guía sobre categorías y etiquetas. En ella se explica por qué las categorías y las etiquetas son diferentes y cómo utilizarlas correctamente.

Ahora se estará preguntando, ¿por qué y cuándo alguien necesitaría usar categorías hijo (subcategorías) en su sitio web WordPress?

Supongamos que está creando un blog de viajes sobre diferentes destinos del mundo. Quizá quieras que los usuarios puedan encontrar artículos tanto por país como por ciudad.

Por ejemplo, podría tener un artículo acerca de los mejores parques acuáticos de Estados Unidos. Sería lógico utilizar “Estados Unidos” como categoría para esa entrada.

Sin embargo, también puede tener artículos acerca de los mejores sitios para comer en Nueva York, Los Ángeles, Chicago, etc. Aquí es donde puede utilizar categorías secundarias o subcategorías. Así, “Estados Unidos” puede convertirse en una categoría principal y las ciudades en categorías secundarias.

Category and subcategory in WordPress

No es necesario que una entrada archivada en una categoría secundaria esté también archivada en la categoría principal. En nuestro ejemplo, podríamos haber dejado “Estados Unidos” sin marcar y haber incluido la entrada en la categoría “Nueva York”.

Si archiva una entrada en la categoría hija pero no en la categoría padre, entonces su entrada aparecerá solo en las páginas de archivo de la categoría hija.

Dicho esto, veamos cómo añadir categorías normales y categorías secundarias en WordPress.

Añadir una categoría en WordPress

Puede añadir fácilmente una nueva categoría en WordPress al escribir una entrada.

En primer lugar, si la barra lateral no se muestra al editar una entrada, tendrás que hacer clic en el icono de engranaje de la parte superior derecha.

A continuación, en el panel de entradas de la derecha, abra la pestaña Categorías.

where to find categories when editing a post

Verás diferentes categorías que ya has creado.

Sin embargo, para crear una nueva categoría, sólo tiene que enlazar el enlace “Añadir nueva categoría”.

Adding a new category in WordPress

Al hacer clic en el enlace, aparecerán dos nuevas casillas en las que podrá añadir su categoría.

Para una categoría normal, no es necesario seleccionar nada en el desplegable Categoría padre.

Enter a category name and parent category

Una vez que haya escrito el nombre de su categoría, sólo tiene que hacer clic en el botón “Añadir nueva categoría”.

La casilla correspondiente a esa categoría se marcará / comprobará automáticamente para su entrada actual. Si lo desea, puede desmarcarla.

Preview of new category

También puede añadir una nueva categoría sin editar una entrada.

Simplemente ve a Entradas ” Categorías y añade tu nueva categoría. Esto es útil si quieres crear todas tus categorías antes de añadir contenido.

Este método también le permite editar el slug (URL ) de sus categorías. Puede borrar y renombrar categorías y darles una descripción. Vea cómo añadir palabras clave SEO y descripciones en WordPress.

Add a new category

Añadir una categoría secundaria (subcategoría) en WordPress

Puede añadir y editar categorías secundarias exactamente del mismo modo que añadió sus categorías principales.

Cuando edites una entrada, abre el panel de ajustes y desplázate hasta la pestaña Categorías.

A continuación, haga clic en la opción “Añadir nueva categoría” y escriba el nombre de la categoría secundaria. A continuación, seleccione en la lista desplegable la categoría que desea utilizar como categoría principal.

Add a subcategory

Del mismo modo, también puedes ir a Entradas ” Categorías para añadir categorías secundarias.

Escriba el nombre de la categoría secundaria y seleccione la categoría principal en el menú desplegable.

Select a parent category

Si lo desea, sus categorías secundarias también pueden tener sus propias categorías secundarias.

Por ejemplo, podríamos decidir desarrollar una estructura de categorías que se utilice para agrupar varios tipos de contenido, como ésta:

Preview of category structure

Aquí, Noticias es una categoría, con los Anuncios como categorías hijas.

Las categorías del mismo nivel dentro de una categoría principal se denominan a veces categorías “hermanas”. Por ejemplo, los Anuncios y las Herramientas SEO son categorías hermanas.

Las categorías solo pueden tener una categoría principal. No puede añadir una subcategoría bajo dos categorías padre diferentes.

Ventajas SEO de la estructura de sitios por categorías

Las URL de sus categorías tendrán el siguiente aspecto:

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

Esto tiene sentido y ayuda a los motores de búsqueda y a los visitantes a entender de qué trata su página. También puede añadir palabras clave a su URL. Las palabras clave ayudan a encontrar contenido en los motores de búsqueda.

WordPress también te permite cambiar fácilmente el prefijo /category/ de las URLs de tus categorías. Incluso puede quitarlo / eliminarlo por completo si lo desea.

Simplemente vaya a la página Ajustes ” Enlaces permanentes del panel de administrador de WordPress y desplácese hasta la sección “Base de categorías”.

Change category permalink settings

Aquí puede introducir el prefijo que desea utilizar y hacer clic en el botón “Guardar cambios” para guardar los cambios.

El prefijo ‘categoría’ en las URL de sus categorías no añade ninguna ventaja a su SEO.

Esta es la razón por la que algunos propietarios de sitios web prefieren quitar / eliminar la palabra ‘categoría’ de las URLs de sus páginas de archivo de categorías en WordPress. Puede hacerlo fácilmente utilizando el plugin All in One SEO, para que las URL de sus categorías tengan este aspecto:

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

Simplemente vaya al menú Apariencia de búsqueda de AIOSEO y seleccione la pestaña Taxonomías. En los ajustes avanzados para Categorías, verá la opción de eliminar el prefijo base de la categoría.

AIOSEO Remove Category Base Prefix

También puede utilizar el plugin FV Top Level Categories. Simplemente instale el plugin y eliminará la palabra ‘categoría’ de las URLs de sus páginas de archivo de categorías.

Importante: Si decide cambiar la base de categorías en un sitio WordPress existente, deberá establecer redirecciones para evitar errores 404 a los visitantes de los motores de búsqueda. Para obtener instrucciones más detalladas, sigue nuestra guía sobre cómo cambiar el prefijo de la base de categorías en WordPress.

Cómo mostrar categorías y categorías secundarias en la barra lateral de WordPress

Puede añadir un bloque de widget a su barra lateral o pie de página de WordPress para mostrar un anuncio / catálogo / ficha. En su escritorio de WordPress, vaya a Apariencia ” Widgets.

Si no has cambiado tus widgets de los que WordPress pone allí por defecto, deberías ver el bloque de widget de Categorías ya en su lugar. Si no es así, puedes hacer clic en el botón “+” y añadir un bloque de “Categoría” a tu área de widgets.

Add a category widget block

Por defecto, el widget mostrará todas sus categorías en una lista plana, por orden alfabético.

He aquí una vista previa de su aspecto en nuestro sitio web de prueba:

Preview of categories in sidebar

Consejo: Las categorías solo aparecerán en la ficha si les has asignado al menos 1 entrada publicada.

Si lo desea, puede cambiarla para que muestre las categorías inferiores (subcategorías) debajo de sus categorías superiores. Simplemente activa la opción ‘Mostrar jerarquía’ en los ajustes del widget de esta manera. No olvide hacer clic en el botón “Actualizar”.

Show hierarchy in widget blocks

En su sitio, ahora debería ver sus categorías principales con las categorías secundarias anidadas debajo de ellas.

Sugerencia: Si los cambios en la barra lateral no se muestran, es posible que tenga que vaciar la caché de WordPress.

Además del bloque por defecto del widget de categorías, también puedes enlazar menús de categorías personalizados utilizando el menú de navegación de WordPress. Después, puedes añadir ese menú a tu menú de cabecera, barra lateral, pie de página u otras ubicaciones de menú.

Esperamos que este tutorial te haya ayudado a aprender cómo añadir categorías y categorías secundarias en WordPress. También puede echar un vistazo a nuestro artículo sobre cómo crear un boletín de correo electrónico para aumentar el tráfico de su sitio web, y nuestra comparación de los mejores creadores de páginas de WordPress para crear disposiciones personalizadas.

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.

Descargo: Nuestro contenido está apoyado por los lectores. Esto significa que si hace clic en algunos de nuestros enlaces, podemos ganar una comisión. Vea cómo se financia WPBeginner , por qué es importante, y cómo puede apoyarnos. Aquí está nuestro proceso 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.

El último kit de herramientas de WordPress

Obtenga acceso GRATUITO a nuestro kit de herramientas - una colección de productos y recursos relacionados con WordPress que todo profesional debería tener!

Reader Interactions

99 comentariosDeja una respuesta

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

Deja tu comentario

Gracias por elegir dejar un comentario. Tenga en cuenta que todos los comentarios son moderados de acuerdo con nuestros política de comentarios, y su dirección de correo electrónico NO será publicada. Por favor, NO utilice palabras clave en el campo de nombre. Tengamos una conversación personal y significativa.