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

Want to add a table of contents to your WordPress posts and pages?

A table of contents facilitates navigation of long articles and improves the SEO of your site. However, it can be difficult for beginners to create.

In this article, I’ll show you how to create a table of contents in your WordPress posts and pages.

Why Add a Table of Contents to Your WordPress Posts and Pages?

You may have seen a table of contents on a website such as Wikipedia.Also use them in WPBeginner for longer guides like ours The Ultimate Guide to WordPress Speed ​​and Performance.

You can add a table of contents to your posts. wordpress website Make it easy to jump between sections of long articles.

In addition to improving the user experience,WordPress SEOThis is because Google can use the table of contents to automatically add “jump to section” links to search results.

Google includes table of contents entries in search results

The table of contents shows that posts are featured snippet It’s at the top of search engine results pages. This will allow you to get maximum his SEO traffic.

The table of contents is also used in featured snippets

With that said, let’s take a look at how to create a table of contents in your WordPress posts and pages. increase.

Add Table of Contents Automatically in WordPress

Ioseois also called all-in-one SEO, Best WordPress SEO Plugins It also incorporates the WordPress table of contents block.

We recommend this method as it saves time by automatically generating a table of contents based on subheadings while still being fully customizable with editable links.

The first thing you need to do is install the free one All-in-one SEO Lite Plugin. For more information, see the step-by-step guide below. How to install a WordPress plugin.

Although you need the free version to easily add a table of contents, AIOSEO Pro has many more features to help you rank higher on search engine result pages.

Once activated, you need to configure the plugin using the AIOSEO setup wizard. For detailed instructions, please refer to the following guides: How to set up WordPress all-in-one SEO correctly.

Adding a table of contents with AIOSEO

You must create or edit a post or page to add a table of contents. After that, click the blue “+” icon to find the “AIOSEO – Table of Contents” block.

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

Simply drag the block onto the post or page where you want the table of contents to appear.

Note: After adding the Table of Contents, you may notice that the “AIOSEO – Table of Contents” block is grayed out. This is because you can only create one table of contents per post or page.

The plugin automatically identifies page headings and adds them to the table of contents. Using different heading levels (such as H2 and H3) indents lower level headings to show the structure of the content.

Headings added to the document are automatically added to the table of contents if you are still writing content for your post or page.

Customize TOC with AIOSEO

There are several ways to customize the table of contents to suit your needs. For example, you can click a heading to rename it. This renames the headings in the table of contents, but not the articles.

Customizing the table of contents

AIOSEO will automatically create an anchor link for each heading. You can edit the anchor text by clicking the link icon. This changes both in the table of contents and in the post content headings.

You can also hide it by clicking the eye icon next to the heading. AIOSEO Pro The user can reorder the headings in the TOC block. Doing this sorts the table of contents headings, but not the article headings.

The sidebar also has block settings. Here you can choose a bulleted or numbered list style for your table of contents.

The table of contents can be a bulleted or numbered list

Finally, when you have finished customizing your table of contents,[完了]You have to click a button to save your changes.

Now you can see how your table of contents will appear to your visitors.

A table of contents is a list of links to post or page headings

We recommend adding headings or paragraphs above the table of contents. This makes it clear to the reader that they are looking at the table of contents.

When a visitor clicks a link in the table of contents, they are immediately taken to that heading in the article. This allows users to jump to the section they are most interested in.

Anchor link preview

The reason I like AIOSEO’s table of contents feature over other WordPress table of contents plugins is that it allows you to customize headings and selectively hide headings as needed.

This is an important feature that most other TOC plugins don’t have.

Add a Table of Contents Manually in WordPress

You can also create a table of contents manually using anchor links without needing a plugin. However, this takes more time and effort.

For more information on anchor links, check out the following guides: How to Add Anchor Links in WordPress.

Enter table of contents

First, we need to add a “List” block where we can add headings for the table of contents. You can type the headings into the list or copy and paste them one by one from the article content.

You must enter a list of headings

How to add anchor text to heading blocks

Next, you need to add an anchor attribute to each heading you reference in your table of contents. This tells WordPress where to jump when a visitor clicks on a heading in the table of contents.

First you need to click on a heading such as H2 or H3. Then you have to click the “Advanced” arrow in the block settings pane to see the advanced settings.

Then enter a unique word or phrase without spaces in the HTML Anchor field. A hyphen can be used to separate each word if desired.

You need to create an HTML anchor attribute for each heading

Then repeat this for all other headings in your table of contents.

Tips: Pasting a heading into this field will automatically add a hyphen. This is an easy way to create a unique ID that clearly represents your heading.

Adding Anchor Links to the Table of Contents

The final step is to link the headings in the table of contents to the HTML anchors you created.

Highlight the first entry in the list block and click[リンク]Click the icon.

Highlight the heading text and click the link icon.

Then enter the hashtag (#) and type or paste the anchor text for that heading.

# tells WordPress to jump to that section of the current post. Do not add domain names or other URL parameters.

Enter the hashtag, then enter the anchor text

Once that’s done, you’ll need to press “Enter” or click the “Send” icon to create the link.

An anchor link is added to the table of contents list. When a visitor clicks on this link, they are immediately taken to that heading in your post or page content.

Anchor link added to table of contents

You can repeat these steps to add anchor links to other headings in your table of contents.

We hope this tutorial helped you learn how to create a table of contents in your WordPress posts and pages. How to increase blog trafficor check the list You need plugins to grow your site.

If you like this article, please subscribe YouTube channel For WordPress video tutorials.You can also find us twitter When Facebook.

post How to Create a Table of Contents in WordPress Posts and Pages first appeared in WP newbie.

https://www.wpbeginner.com/plugins/how-to-create-a-table-of-content-in-wordpress-posts-and-pages/ How to Create a Table of Contents in WordPress Posts and Pages

Show More
Back to top button