#66781·wp-calypso

Table of contents block – links don't work on initial save

Author: tanjoymorCreated Aug 20, 2022Updated Sep 21, 2026
Labels[Status] Core Fix Needed[Platform] Simple[Platform] AtomicWordPress.comThird Party FixEditor ExperienceCustomer signal > CleanedCustomer Report > Direct

Quick summary

If you add the Table of Contents block to a new page, when you publish the page, the links don't work properly and instead open a new page with a Page not found error. The URL is retaining an auto-draft in it. If you edit and Update the page, the links will then work properly. Alternatively, if you publish the page first, then add the Table of Contents block, they will work correctly.

https://user-images.githubusercontent.com/42655541/185758215-2ba7418d-aed8-4e33-a008-327fb0fa8ae8.mp4

Steps to reproduce

  1. Create a new page
  2. Add content, with headings, and the Table of Content block
  3. Publish the page
  4. View the page
  5. Try the TOC links
  6. Return to the editor and make a change
  7. Update the published page
  8. View the page
  9. The TOC links now work

What you expected to happen

I expected the links to work when I first published the page with the content and TOC block in place.

What actually happened

The TOC links open a new page with a Page not found error.

Context

Discovered while explaining to a customer how the Table of Contents block works. Worth noting that as per regular anchor links, the TOC links also don't work if the page is saved as a draft. Would be worth including a notice of this and adding it to the support documentation.

Platform (Simple, Atomic, or both?)

Simple, Atomic

Theme-specific issue?

No response

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

All

Available workarounds?

Yes, difficult to implement

Workaround details

The work around isn't "difficult" per se, but it's not intuitive and users won't think to try it. You either need to publish the page "before" adding the TOC block, OR you need to make a change and update the page again after publishing it. This feels like a pretty high priority to fix for a brand new block.