WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The feature did work in the past however pages now seem to default to 'Default Template'.

I can see my available page templates in the drop-down on the Page edit page, however after saving the admin simply shows 'Default Template' again.

I have tried disabling all plugins as well as remaking some of the templates, however the behaviour continues.

Any ideas?

Note: I'm using latest self-hosted WordPress.

Update: After some digging it would appear that I am getting 'Table xxx/wp_postmeta' is marked as crashed and should be repaired". However running repair through phpmyadmin does not fix the issue.

Update: Rebuilt the table entirely, still have issue.

(Originally posted this question here: http://webapps.stackexchange.com/questions/33627/wordpress-page-edit-does-not-save-selected-template)

share|improve this question
Switch to the default WordPress theme and try adding a custom page template to that theme and test whether or not setting a template under page attributes saves correctly. If so, then its likely something in your functions.php causing the issue (if you say all plugins are disabled). – userabuser Oct 24 '12 at 8:31
Still having the same issue with a default theme. – Ing Oct 24 '12 at 8:44
Full troubleshooting? – brasofilo Oct 24 '12 at 9:41
Looked through that now, checked a couple of things I had not before. Issue remains. – Ing Oct 24 '12 at 10:46
Have you tried your theme on a fresh install of wordpress? At least try replacing the wp-admin folder. (Don't forget to backup first.) – Cthulhu Oct 26 '12 at 15:33

It sounds like your WordPress installation is coruppted. I'd try removing all of the files (except perhaps the wp-content/ folder and the wp-config.php and .htaccess files), and then uploading a fresh installation of WordPress.

Create a new MySQL database, if you can, and run the WordPress installer. After installation, you can try importing your blog content back using the Tools menu in the WordPress administration dashboard.

It's also a good idea to check for bad code. You've probably already tried reverting to the default theme (Twenty Ten, Twenty Eleven, Twenty Twelve), and disabling all plugins, but you also need to check if there's any files in the wp-content/mu-plugins directory, if it exists.

Good luck solving the problem.

share|improve this answer
+1 / Thank you for your input, good general troubleshooting tips... – Ing Oct 28 '12 at 17:26
up vote 0 down vote accepted

Turns out this was an issue with my hosting.

phpmyadmin although reporting operations as complete was not actually committing repairs / optimisations. Now querying why this is with the company.

So the simple fix was indeed to simply repair + optimise the table.

share|improve this answer

I had the same problem and solved it.

I solved it by going to the table wp_postmeta (through phpMyAdmin) and just edit the record where:

post_id = {your post id or page id}
meta_key = _wp_page_template

I have changed the _wp_page_template's meta_value to default

Hope it works!

share|improve this answer
While your solution may work, there is not enough detail here to guide someone through it. Could you edit the answer so that someone with little experience could follow it? – s_ha_dum Jan 23 '13 at 18:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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