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 crear un índice de contenidos en entradas y páginas de 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 añadir un índice de contenidos a tus entradas o páginas de WordPress?

Un índice de contenidos (TOC) puede facilitar la navegación por un artículo largo y mejorar el SEO de su sitio WordPress. Sin embargo, su creación puede resultar complicada para los principiantes.

En este artículo, le mostraremos cómo crear una tabla de contenidos en entradas y páginas de WordPress.

How to Create a Table of Contents in WordPress Posts and Pages

¿Por qué añadir una tabla de contenidos a entradas y páginas en WordPress?

Es posible que hayas visto la tabla de contenidos en sitios web como Wikipedia. También los utilizamos en WPBeginner para nuestros artículos largos, como nuestra guía definitiva para aumentar la velocidad y el rendimiento de WordPress.

Puede añadir una tabla de contenidos a las entradas de su sitio web en WordPress para facilitar el salto entre las secciones de un artículo largo.

No solo mejoran la experiencia del usuario, sino que también ayudan al SEO de WordPress. Esto se debe a que Google puede utilizar la tabla de contenidos para añadir automáticamente enlaces de “saltar a la sección” en los resultados de búsqueda.

Google Includes Table of Contents Entries in Search Results

Un índice de contenidos también puede ayudar a que su entrada aparezca como fragmento de código destacado en la parte superior de la página de resultados del motor de búsqueda.

Esto le ayudará a conseguir el máximo tráfico SEO.

Tables of Contents Are Also Used in Featured Snippets

Dicho esto, vamos a ver cómo crear fácilmente un índice de contenidos en entradas y páginas de WordPress. Te mostraremos cómo hacerlo automáticamente con un plugin y manualmente usando enlaces de anclaje:

Método 1: Añadir una tabla de contenidos automáticamente en WordPress

AIOSEO, también conocido como All in One SEO, es el mejor plugin SEO para WordPress, y viene con un bloque de tabla de contenidos integrado para WordPress.

Recomendamos este método porque le ahorra tiempo al generar automáticamente el índice de contenidos basándose en sus subtítulos, al tiempo que lo hace completamente personalizable con enlaces editables.

Para más información, consulte nuestra reseña / valoración completa de AIOSEO.

Lo primero que debe hacer es instalar el plugin gratuito All in One SEO Lite. Para más detalles, consulta nuestra guía paso a paso sobre cómo instalar un plugin de WordPress.

Sólo necesita la versión gratuita para añadir fácilmente un índice de contenidos, pero AIOSEO Pro ofrece aún más características que le ayudarán a posicionarse mejor en las páginas de resultados de los motores de búsqueda.

Una vez activado, deberá configurar el plugin mediante el asistente de configuración de AIOSEO. Para obtener instrucciones detalladas, consulte nuestra guía sobre cómo establecer All in One SEO para WordPress correctamente.

Añadir una tabla de contenidos con All in One SEO

Tendrás que crear o editar la entrada o página en la que deseas añadir el índice de contenidos. A continuación, haz clic en el icono azul “+” del editor de bloques y busca el bloque “AIOSEO – Tabla de contenidos”.

Add an AIOSEO Table of Contents Block to the Post or Page

Simplemente arrastre el bloque a la entrada o página en la que desea que aparezca el índice de contenidos.

Nota: Una vez que añada un índice de contenidos, puede que note que el bloque “AIOSEO – Índice de contenidos” aparece en gris. Esto se debe a que solo puedes tener un índice por entrada o página.

El plugin identificará automáticamente los encabezados de la página y los añadirá a su tabla de contenidos. Si utiliza diferentes niveles de encabezados (por ejemplo, H2 y H3), los encabezados de nivel inferior se sangrarán para mostrar la estructura de su contenido.

Si todavía está escribiendo el contenido de su entrada o página, los encabezados que añada al documento se añadirán automáticamente al índice.

Personalización del índice de contenidos con SEO All in One

Hay varias formas de personalizar el índice para adaptarlo a sus necesidades. Por ejemplo, puede hacer clic en un encabezado para cambiarle el nombre. Esto renombrará el encabezado en la tabla de contenidos pero no el artículo.

Customizing Your Table of Contents

AIOSEO creará automáticamente enlaces de anclaje para cada encabezado. Puede hacer clic en el icono Enlazar para editar el texto de anclaje, y éste se modifica tanto en el índice como en el encabezado en el contenido de la entrada.

También puede hacer clic en el icono del ojo situado al lado de cualquiera de los encabezados para ocultarlo. Los usuarios de AIOSEO Pro pueden reordenar los encabezados en el bloque del índice de contenidos. Al hacerlo, se reordenarán los encabezados en el índice de contenidos, pero no en el artículo.

También encontrará un ajuste para el bloque de la barra lateral. Aquí puede elegir un estilo de lista numerada o con viñetas para el índice de contenidos.

Your Table of Contents Can Be in a Bulleted or Numbered List

Por último, cuando haya terminado de personalizar su tabla de contenidos de WordPress, deberá hacer clic en el botón “Hecho” para guardar los cambios.

Ahora podrá ver qué aspecto tendrá el índice para sus visitantes.

Your Table of Contents is a List of Links to Headings in the Post or Page

Es una buena idea añadir un encabezado o un párrafo encima del índice. De este modo, los lectores tendrán claro que se trata de un índice.

Cuando sus visitantes hagan clic en un enlace del índice de contenidos, irán inmediatamente a ese encabezado del artículo. Esto permite a los usuarios saltar a la sección que más les interesa.

Anchor link preview

La razón por la que nos gusta la característica de tabla de contenidos de AIOSEO es que le permite personalizar los encabezados y ocultar selectivamente los encabezados según sea necesario.

Esta es una característica crítica que la mayoría de los otros plugins de tabla de contenidos simplemente no tienen.

Método 2: Añadir una tabla de contenidos manualmente en WordPress

También puede crear una tabla de contenidos manualmente utilizando enlaces de anclaje sin necesidad de un plugin. Sin embargo, esto le llevará más tiempo y esfuerzo.

Puede obtener más información acerca de los enlaces de anclaje en nuestra guía sobre cómo añadir enlaces de anclaje en WordPress.

Introducir el índice de contenidos

En primer lugar, debe añadir un bloque “Lista” en el que podrá añadir los encabezados del índice. Puede escribir los encabezados en la lista o copiarlos y pegarlos uno a uno desde el contenido de su artículo.

You Need to Type a List of Headings

Cómo añadir texto de anclaje a los bloques encabezados

A continuación, tendrá que añadir un atributo de anclaje a cada encabezado al que desee hacer referencia en la tabla de contenidos. Esto permitirá a WordPress saber dónde saltar cuando un visitante haga clic en el encabezado de la tabla de contenidos.

Primero debe hacer clic en el encabezado, como H2 o H3. A continuación, debe hacer clic en la flecha “Avanzado” del panel de ajustes del bloque para mostrar los ajustes avanzados.

A continuación, introduzca una palabra o frase única sin espacios en el campo “Anclaje HTML”. Si lo desea, puede utilizar guiones para separar cada palabra.

You Need to Create an HTML Anchor Attribute for Each Heading

A continuación, repita esta operación para todos los demás encabezados que se incluirán en el índice.

Sugerencia: Si pega el encabezado en este campo, se añadirán guiones automáticamente. Esta es una forma sencilla de crear un ID único que también represente vaciamente el encabezado.

Añadir enlaces de anclaje al índice de contenidos

El último paso consiste en enlazar los encabezados del índice con los anclajes HTML que ha creado.

Marque la primera entrada del bloque de su lista y haga clic en el icono “Enlazar” de la barra de herramientas.

Highlight the Heading Text and Click the Link Icon

A continuación, debe escribir un hashtag (#) y luego escribir o pegar el texto de anclaje de ese encabezado.

El # indica a WordPress que salte a esa sección de la entrada actual. No añade el nombre de dominio u otros parámetros URL.

Type a Hashtag and Then the Anchor Text

Una vez hecho esto, pulse “Intro” o haga clic en el icono “Enviar” para enlazar.

El enlace de anclaje se añadirá a su tabla de contenidos. Cuando sus visitantes hagan clic en este enlazar, serán llevados inmediatamente a ese encabezado en los contenidos de la entrada o página.

An Anchor Link Is Added to the Table of Contents

Puede repetir estos pasos para añadir enlaces de anclaje a los demás encabezados del índice.

Esperamos que este tutorial te haya ayudado a aprender cómo crear una tabla de contenidos en entradas y páginas de WordPress. Puede que también quieras ver nuestra guía sobre cómo aumentar el tráfico de tu blog o nuestra selección experta de los plugins de WordPress imprescindibles para hacer crecer tu sitio.

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

71 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. Sam Smith says

    I am in word press post editor and I do not see the blue plus button or the advanced block. How do I see those features?

    • WPBeginner Support says

      If you re using the block editor then you may want to try disabling distraction free editing in the top-right and that should allow you to see the plus again.

      Administrador

  3. Ahmed Omar says

    I am already using the first method, and it help my site to appear first in some search results and of course bringing more visitors
    Thank you

  4. ario says

    I tried to create table of content manually like the way you taught us and it worked well, until I added page break and separated the points into different parts or pages. Is there a solution for this?

    • WPBeginner Support says

      If you separate the page then you would need to include the entire URL before the # as well as the anchor to link correctly.

      Administrador

  5. Mark says

    Back in the day, when websites were new, we used to call this a Site Map. But yeah, it was kind of expected for the search engines to find a site map on your website.
    Thanks for the reminder and the info.

    • WPBeginner Support says

      If the information added is the same, then there is no difference. The plugin is there to help make the process easier and help ensure any markup is properly added.

      Administrador

  6. Tay says

    How can I manually place the TOC on specific pages? It seems I can only disable auto-insertion but I can’t then decide where I want to put the table on the page. Is this possible?

    • WPBeginner Support says

      The table of contents would need to be enabled for pages and then there should be an option when editing the specific page you want to add it to.

      Administrador

  7. Muhammad Arslan Sharif says

    What a tutorial and very helpful for me and other who want to add new features in their websites and in blogs. In very short words you explain exceptionally.

  8. Kim Balchios says

    My developer created a Table of Contents on a really long blog I wrote. I edited one of the entries and the link fell off.

    When I try to create a new entry it says “Paste URL or type to search.” If I add the URL, it will take the reader to the top of the blog not the exact place inside the blog.

  9. David Ellin says

    this video shows me how to create a table of contents within a post. I want to create a table of contents for my entire blog so that the title of each article appears in the TOC. How do I do that?

  10. jean says

    Hi thank you for this informative post!
    Only a small question, what is “override the global settings for this specific post / page.”
    I chose to insert the table of content manually, and when i check only for h2 & h3, the table of content just doesn’t show up at all.

    Thank you!

    • WPBeginner Support says

      That would mean you are telling it to ignore your default settings for the plugin for that specific post/page. If you have no H2 or H3s on the page then there wouldn’t be anything for the plugin to add to the table.

      Administrador

    • WPBeginner Support says

      If the page is too short to scroll then there wouldn’t be a reason to have a table of contents. It is a personal preference for the length of a post.

      Administrador

  11. SAHIL DHIMAAN says

    Hi, very helpful article

    But….

    Table of content isn’t showing in Mobile, what to do…

    i use AMP plugin also…

    • WPBeginner Support says

      Your AMP plugin would be removing the plugin’s additions. If you reach out to the table of contents plugin’s support they can let you know if they have AMP support.

      Administrador

  12. Lucimar says

    Good afternoon!

    Congratulations on the article, it helped me a lot :)

    However, it just didn’t work on amp pages.
    Note: I use the “Accelerated Mobile Pages” plugin.

    How can I solve?

    Thank you!

    • WPBeginner Support says

      You would want to reach out to the plugin’s support for if there is a recommendation for AMP.

      Administrador

  13. Luke Richardson says

    Using easy table of contents, is there an option to create hyperlinks to jump to that particular section when you click on one of the headings in the table.

    Not sure if I’m missing something with the plugin, but when I click on the headings it doesn’t jump to that section at all.

    thanks

    • WPBeginner Support says

      The plugin should be allowing that, you may want to ensure there is enough room between your content and you don’t have any browser addons that would prevent scrolling to a certain section of your page.

      Administrador

  14. Tosh Lubek says

    I’ve checked “Initially hide the table of contents” but the TOC shows every time I open a post with a TOC. Is there something else I need to do?

    • WPBeginner Support says

      You would want to reach out to the plugin’s support to ensure this is not a conflict between the plugin and your theme

      Administrador

  15. Oulimata says

    As usual, amazingly detailed and helpful. You guys have definitely become my go-to resource for anything blogging related.

    • WPBeginner Support says

      You would need to enable custom CSS and depending on your theme would determine the CSS needed

      Administrador

    • WPBeginner Support says

      You would enable support for the post type you want to have the table of contents in and when you edit one of the types where it is activated, it will have the option at the bottom of the editor to add the table of contents

      Administrador

    • WPBeginner Support says

      In the plugin’s settings you would enable support for pages and you should be able to follow the same procedure for pages that you do for posts.

      Administrador

  16. Abhishek says

    Hi, is this possible to show/hide individual headings, just by clicking on it, like on Wikipedia?

    I have too many subheadings under each h3 so I want it to be easier to navigate.

  17. Prince Gabriel Okocha says

    I have installed this plugin on my blog following the guideline in this post. But it’s not showing up on my posts. Is there anything I’m doing wrong? I really need this to ASAP

    • WPBeginner Support says

      Hello,

      Please review plugin settings, you need to enable support for the posts and pages. After that edit the post and page and below the post editor you will find TOC settings. From here, you need to check the box ‘Insert table of contents’ to add it in that particular post.

      Administrador

  18. Srinu says

    Thanks for the article it’s working for me, But I am getting with bullets and numbers, in TOC_Box how to change it. I already numbered with h2 tags.
    so its repeated the numbers twice.

  19. Mae says

    Thank you so much! I used this for my Exclusives Library and I love it! Now my subscribers won’t have a difficult time looking for their printables.

    XOXO,
    Mae

  20. Jan Peter Aursnes says

    A fine plugin, but is there any way I can exclude pages? Writing in headings and using * and ⎮ does not work, for me anyway. I am not a tech guy so it could be I just need a bit of explanation.

    Thanks in advance.

  21. Raushan says

    This is best plugin but when i created table of content from this plugin then showing multiple H1 tag which is not good at seo point of view.
    How to solve this ?
    Thanks

  22. Sunil Suresh says

    Thanks. Your article came at the right time for me! I was just now looking for something like this for a client of mine.

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.