Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Puchar WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Jak utworzyć spis treści w wpisach i stronach WordPressa?

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Czy chcesz dodać spis treści do twoich wpisów lub stron WordPress?

Spis treści (TOC) może ułatwić nawigację po długim artykule i poprawić SEO twojej witryny WordPress. Jednak ich tworzenie może być trudne dla początkujących.

W tym artykule pokażemy, jak utworzyć spis treści w wpisach i na stronach WordPress.

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

Dlaczego warto dodawać spis treści do wpisów i stron w WordPressie?

Być może widziałeś spis treści na witrynach internetowych takich jak Wikipedia. Używamy ich również na WPBeginner do naszych długich artykułów, takich jak nasz ostateczny przewodnik po zwiększeniu szybkości i wydajności WordPressa.

Możesz dodać spis treści do wpisów na twojej witrynie internetowej WordPress, aby ułatwić przeskakiwanie między sekcjami długiego artykułu.

Nie tylko poprawiają one komfort użytkowania, ale także pomagają Twojemu WordPress SEO. Dzieje się tak, ponieważ Google może używać spisu treści do automatycznego dodawania odnośników „przejdź do sekcji” w wynikach wyszukiwania.

Google Includes Table of Contents Entries in Search Results

Spis treści może również pomóc w wyświetleniu twojego wpisu jako fragmentu kodu na górze strony wyników wyszukiwania.

Pomoże to uzyskać maksymalny ruch SEO.

Tables of Contents Are Also Used in Featured Snippets

Mając to na uwadze, przyjrzyjmy się, jak łatwo utworzyć spis treści w wpisach i stronach WordPress. Pokażemy, jak zrobić to automatycznie za pomocą wtyczki i ręcznie za pomocą odnośników kotwic:

Metoda 1: Automatyczne dodawanie spisu treści w WordPressie

AIOSEO, znane również jako All in One SEO, jest najlepszą wtyczką WordPress SEO i posiada wbudowany blok spisu treści dla WordPress.

Zalecamy tę metodę, ponieważ pozwala ona zaoszczędzić czas dzięki automatycznemu generowaniu spisu treści na podstawie twoich podtytułów, a jednocześnie umożliwia jego pełne dostosowanie za pomocą edytowalnych odnośników.

Aby uzyskać więcej informacji, zobacz naszą pełną recenzję AIOSEO.

Pierwszą rzeczą, którą musisz zrobić, to zainstalować darmową wtyczkę All in One SEO Lite. Aby uzyskać więcej informacji, zapoznaj się z naszym przewodnikiem krok po kroku, jak zainstalować wtyczkę WordPress.

Wystarczy darmowa wersja, aby łatwo dodać spis treści, ale AIOSEO Pro oferuje jeszcze więcej funkcji, które pomogą Ci uzyskać lepszą pozycję na stronach wyników wyszukiwania.

Po włączaniu należy skonfigurować wtyczkę za pomocą kreatora konfiguracji AIOSEO. Szczegółowe instrukcje można znaleźć w naszym przewodniku na temat prawidłowej konfiguracji All in One SEO dla WordPress.

Dodawanie spisu treści za pomocą All in One SEO

Musisz utworzyć lub edytować wpis lub stronę, na której chcesz dodać spis treści. Następnie kliknij niebieską ikonkę „+” w edytorze bloków i znajdź blok „AIOSEO – Spis treści”.

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

Wystarczy przeciągnąć blok na wpis lub stronę, na której ma pojawić się spis treści.

Uwaga: Po dodaniu spisu treści możesz powiadomić, że blok „AIOSEO – Spis treści” będzie wyszarzony. Wynika to z faktu, że na wpis lub stronę można dodać tylko jeden spis treści.

Wtyczka automatycznie zidentyfikuje nagłówki na stronie i doda je do twojego spisu treści. Jeśli użyjesz różnych poziomów nagłówków (powiedzmy H2 i H3), nagłówki niższego poziomu zostaną wcięte, aby pokazać strukturę twojej treści.

Jeśli nadal piszesz treść swojego wpisu lub strony, to wszelkie nagłówki dodane do dokumentu zostaną automatycznie dodane do spisu treści.

Konfigurator spisu treści z All in One SEO

Istnieje kilka sposobów na dostosowanie spisu treści do twoich potrzeb. Można na przykład kliknąć nagłówek, aby zmienić jego nazwę. Spowoduje to zmianę nazwy nagłówka w spisie treści, ale nie artykułu.

Customizing Your Table of Contents

AIOSEO automatycznie utworzy odnośniki kotwicy dla każdego nagłówka. Możesz kliknąć ikonkę odnośnika, aby edytować tekst kotwicy, który zostanie zmieniony zarówno w spisie treści, jak i w nagłówku w treści wpisu.

Można również kliknąć ikonkę oka obok dowolnego nagłówka, aby go ukryć. Użytkownicy AIOSEO Pro mogą zmieniać kolejność nagłówków w bloku spisu treści. Spowoduje to zmianę kolejności nagłówków w spisie treści, ale nie w artykule.

Na pasku bocznym znajduje się również ustawienie bloku. Tutaj możesz wybrać styl listy wypunktowanej lub numerowanej dla twojego spisu treści.

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

Na koniec, po zakończeniu konfiguratora twojego spisu treści WordPress, musisz kliknąć przycisk „Gotowe”, aby zapisać zmiany.

Teraz będziesz mógł zobaczyć, jak spis treści będzie wyglądał dla twoich odwiedzających.

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

Dobrym pomysłem jest dodanie nagłówka lub akapitu nad spisem treści. Dzięki temu czytelnicy będą wiedzieć, że oglądają spis treści.

Gdy odwiedzający twoją stronę klikną odnośnik w spisie treści, zostaną natychmiast przeniesieni do tego nagłówka w artykule. Pozwala to użytkownikom przejść do sekcji, którą są najbardziej zainteresowani.

Anchor link preview

Powodem, dla którego lubimy funkcję spisu treści AIOSEO, jest to, że pozwala ona dostosować nagłówki i selektywnie ukrywać nagłówki w razie potrzeby.

Jest to krytyczna funkcja, której większość innych wtyczek do spisu treści po prostu nie ma.

Metoda 2: Ręczne dodawanie spisu treści w WordPressie

Spis treści można również utworzyć ręcznie za pomocą odnośników kotwic bez konieczności korzystania z wtyczki. Wymaga to jednak więcej czasu i wysiłku.

Więcej o anchor linkach dowiesz się z naszego przewodnika na temat dodawania anchor linków w WordPressie.

Rodzaj spisu treści

Najpierw należy dodać blok „Lista”, w którym można dodać nagłówki spisu treści. Możesz wpisać nagłówki do listy lub skopiować je i wkleić jeden po drugim z treści twojego artykułu.

You Need to Type a List of Headings

Jak dodać tekst kotwicy do bloków nagłówków?

Następnie musisz dodać atrybut kotwicy do każdego nagłówka, do którego chcesz się odwołać w spisie treści. Dzięki temu WordPress będzie wiedział, gdzie przeskoczyć, gdy odwiedzający kliknie nagłówek w spisie treści.

Najpierw należy kliknąć nagłówek, taki jak H2 lub H3. Następnie należy kliknąć strzałkę „Zaawansowane” w panelu ustawień bloku, aby wyświetlić ustawienia zaawansowane.

Następnie wpisz unikatowe słowo lub frazę bez spacji w polu „Kotwica HTML”. Jeśli chcesz, możesz użyć myślników do oddzielenia każdego słowa.

You Need to Create an HTML Anchor Attribute for Each Heading

Następnie powtórz tę czynność dla wszystkich innych nagłówków, które zostaną dołączone do spisu treści.

Wskazówka: Jeśli wkleisz nagłówek do tego pola, myślniki zostaną dodane automatycznie. Jest to łatwy sposób na utworzenie unikatowego identyfikatora, który jednocześnie wyraźnie reprezentuje nagłówek.

Dodawanie odnośników kotwic do spisu treści

Ostatnim krokiem jest powiązanie nagłówków w spisie treści z utworzonymi kotwicami HTML.

Powinieneś podświetlić pierwszy wpis na twojej liście zablokowanych, a następnie kliknąć ikonkę „odnośnika” na pasku narzędzi.

Highlight the Heading Text and Click the Link Icon

Następnie należy wpisać hashtag (#), a następnie wpisać lub wkleić tekst kotwicy dla tego nagłówka.

Znak # mówi WordPressowi, aby przeskoczył do tej sekcji obecnego, aktualnego wpisu. Nie dodajesz nazwy domeny ani innych parametrów adresu URL.

Type a Hashtag and Then the Anchor Text

Gdy to zrobisz, musisz nacisnąć „Wpisz” lub kliknąć ikonkę „Prześlij”, aby utworzyć odnośnik.

Kotwica odnośnika zostanie dodana do twojego spisu treści. Gdy odwiedzający klikną ten odnośnik, zostaną natychmiast przeniesieni do danego wpisu lub treści strony.

An Anchor Link Is Added to the Table of Contents

Możesz powtórzyć te kroki, aby dodać odnośniki kotwic do innych nagłówków w spisie treści.

Mamy nadzieję, że ten poradnik pomógł ci dowiedzieć się, jak utworzyć spis treści w wpisach i stronach WordPress. Możesz również zapoznać się z naszym przewodnikiem na temat tego, jak zwiększyć ruch na blogu lub z naszą ekspercką listą niezbędnych wtyczek WordPress do rozwoju twojej witryny.

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.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

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.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

71 komentarzyZostaw odpowiedź

  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.

      Administrator

  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.

      Administrator

  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.

      Administrator

  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.

      Administrator

  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.

      Administrator

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

      Administrator

  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.

      Administrator

  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.

      Administrator

  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.

      Administrator

  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

      Administrator

  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

      Administrator

    • 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

      Administrator

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

      Administrator

  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.

      Administrator

  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.

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.