Workarounds for the Page Template Bug in WordPress 4.9

WordPress 4.9 “Tipton” was released last week and although it’s largely trouble-free, there is one particular issue users and developers are running into that’s causing frustration. In 4.9, custom page templates that are created fail to display in the Template drop-down menu. The issue is related to changes made to the file editor.

Previous versions of WordPress listed files 2-levels deep in the editor. In 4.9, the entire directory tree for a theme is listed regardless of its depth. Caching was added to help limit the performance impacts of loading large WordPress themes. “An unintended side effect of the caching is that the same directory listing function get_files is used both for the theme editor and for gathering page templates,” Weston Ruter, Co-Release Lead for WordPress 4.9 said.

Within the trac ticket, developers suggests that a button be added that flushes all caches or disabling the cache if WP_DEBUG is set to true. Neither suggestion turned into a patch committed to core. Instead, Ruter has released a plugin as a workaround that flushes the template cache. Other workarounds include, bumping the theme’s version, running the wp cache flush command in WP CLI, or waiting 60 minutes for the cache to expire.

The ticket is marked as a high priority but because of the upcoming holidays in the US and WordCamp US next weekend, it could be at least a few weeks before WordPress 4.9.1 is released.


14 responses to “Workarounds for the Page Template Bug in WordPress 4.9”

  1. Hi, after the 4.9 update, I can no longer edit my custom html widgets, on clicking on them i get the options either to cancel or delete the particular widget, they do not open as drop-down sections, and it seems I have lost the access to edit the codes or to add new codes in the custom html widgets.

    Please help!

    • hi Swag , I just encountered the same issue with my widgets ,I went to my Hosting provider & they fixed it bye adding a piece of code to the
      php file sorry I don’t have the piece of code it was in chat window &
      I got sidetracked & didn’t copy it grrr .
      try contacting your hosting company they will be able to help with this issue .
      regards Paul @ e-z

  2. This doesn’t seem like a good idea to me. Relying on cache flushing for something like this seems bound to cause problems. Perhaps reverting to the original system will be necessary.

  3. Hi! I have some issues with my page, when i upgrade to 4.9 this broke my permalinks, if you try enter to the link clicking the menu dsnt work and the page stay in stand by. But if you type the link work normally. This problem may change, for example, i have this problem friday, saturday the web is ok, sunday problem again. Can you help me guys? (sorry my english) The page is

  4. This was such a frustrating bug when I ran into it on two different web development project earlier this month. I simply waited 60 minutes for it all to refresh on it’s own both times.

    Very useful tip here though, thanks.


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: