Template name does not display properly when a theme.json is present
Description
I expect the page template title to display in the sidebar Summary panel when I select a new custom page template. If I don't have a theme.json in my theme, this works as expected.
If I do have a theme.json in my theme, the template title displays Default template instead of the custom page template title.
This happens if I add a template in the customTemplates array in theme.json – or if I use a classic PHP template and don't include it in a customTemplates array in the theme.json.
Step-by-step reproduction instructions
- Add a page template to any theme without using a
theme.json. - Create a new post.
- In the sidebar Summary panel, click "Default template" and select the custom page template in the modal.
- Close the modal and see that the new page template title is displayed instead of "Default template".
- Add a basic
theme.jsonto the theme. - Create a new post.
- In the sidebar Summary panel, click "Default template" and select the custom page template in the modal.
- Close the modal and see that the new page template title is not displayed. See that the template title still says "Default template".
Screenshots, screen recording, code snippet
The page template is selected in the modal, but "Default template" still displays as the template title in the Summary panel. This theme has a theme.json.

Environment info
- WP 6.1.1, any theme
- Gutenberg version 14.1
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Hi! I believe this is a duplicate of https://github.com/WordPress/gutenberg/issues/41449 ?
Hi! I believe this is a duplicate of #41449 ?
@carolinan No, I believe that's different. It looks like #41449 is a suggestion for UX improvement. This is a bug. The template title displays as expected when there's no theme.json. But when there's a theme.json, the template title displays "Default template" no matter what template is selected.
In the logic, it appears that there's an assumption that, if there's a theme.json, then it's a block theme and therefore using the wp_template post type to store templates. When that's not found, then "Default template" is displayed rather than picking up the template title from the file in the theme or from the theme.json.
Just stumbled upon this issue as well on a production website for a client