In my Drupal site I'd been adding the TOC while feeding the content and on saving both get stored in the database. This TOC is really useful for the visitors (Google also likes it).

However I want to generate the TOC dynamically using JavaScript as it gives me flexibility to improve/update the TOC at once site wide for all the content pages, plus it saves DB space.

How will this change affect SEO? Will Google give the dynamically generated TOC same weight as that of statically generated ones?

  • 2
    What is your table of contents? Is it like an HTML sitemap with lots of links to different pages, or is it a list of links at the top of a page that point to the specific sections of a page? Apr 22, 2018 at 7:16
  • 1
    @StephenOstermiller the HTML sitemap on the top of a page will point to different sections of a long page.
    – user5858
    Apr 22, 2018 at 7:30
  • First time ever my bounty hasn't elicited any response.
    – user5858
    Apr 28, 2018 at 11:06
  • @user5858 because it isn't clear, what kind of answer do you waiting for. It is no difference between statically and dynamically, if dynamically happens till time slot of 5-6 seconds is closed - thats what i was talking about in my answer.
    – Evgeniy
    Apr 30, 2018 at 8:26

1 Answer 1


You can try it one url. But i think, if the TOC is written into DOM in the time no longer as, say, 5 seconds after onLoad event, than you are on secure side.

If Google takes your TOC as sitelinks into SERP, be mindful that it will be disappear at first, if your site will load just a little bit longer. 6 seconds after onLoad is critical time gap - everything written into DOM after this time doesn't appear.

I personally wouldn't write TOC on this way - i see different ways to automatically create TOC from HTML headings and anchors.

  • I'm not sure if I can rely on your answer.
    – user5858
    Apr 30, 2018 at 9:19
  • @user5858 as i written before, you'll get no answer, which will be more sustainable. This is the cause for bounty disinteresse. Again, as i written before, you can test it by yourself.
    – Evgeniy
    Apr 30, 2018 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.