Changing a WordPress page template in phpMyAdmin

Changing a WordPress page template in phpMyAdmin
<?php /* Template Name: Full Width */ ?>

instead of

<?php

/* Template Name: Full Width */

*/ ?>

I recently updated my WordPress from 5.7 to 5.8 but my theme was not updated to support 5.8. The only issue I ran into is it did not give me the option to change the template of my page anymore. This created issues because my theme uses templates to define its layout for each page. So I discovered a temporary workaround until my theme gets updated.

  • Before you start you need to know your page id number. It will show up in your URL if you are not using custom permalinks.
  • login into phpMyAdmin
  • locate your WordPress database (you can select it in the sidebar or from the drop-down depending on your version)
  • select the wp_postmeta table
  • sort by post_id and locate your page id number.
  • Under the meta_key column find the record that says wp_page_template
  • hange the meta_value to the template of your choice. ( I changed mine from default to template_home.php which is the homepage template for my theme.
Changing a WordPress page template in phpMyAdmin
Changing a WordPress page template in phpMyAdmin

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top