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

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.