• Resolved TangerineFrog

    (@tangerinefrog)


    Not sure whether anyone else has had this same problem.

    I had previously changed the database table default prefixes from wp- to a custom number as recommended by WP to prevent hackers. However, since the last WP update I have found that each time I apply a custom page template in my theme to a page on my website it changes my custom number in the DB of that particular page back to its default of wp-.

    If I then edit the wp- and change it back to my custom number, it changes the custom page template in my theme back to it’s default (ie. Default Template) and I lose all the customisations of the custom page template.

    I’ve tried changing the database table prefixes I was using to a different number and also re-created a new wp-config.php file and changed themes to rule out the problem being theme-specific—all to no avail.

    Perhaps something is over-riding the wp-config.php file? Does anyone have any ideas what the problem could be and how it could be solved?

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Its really strange, How you are sure that db prefix is changed, can you list down all the table of your DB.

    Thread Starter TangerineFrog

    (@tangerinefrog)

    Thanks for your reply. It’s odd. I have the DB and my web page side by side in different browsers and can physically see the change when I refresh the screen. I’ve never had this happen before.

    A single entry in the _postmeta table in the meta_key column changes from _xxxxxxxx_page_template back to the wp default of _wp_page_template.

    _wp_page_template is default custom field which keep the template information. Nothing wrong with your setup.

    Thread Starter TangerineFrog

    (@tangerinefrog)

    In codex.ww.wp.xz.cn they advise changing the prefix to prevent SQL-injection attacks. I’ve used different prefixes in a DB before without a problem until now. Below is an excerpt from the codex:

    codex.ww.wp.xz.cn/Hardening_WordPress

    Change the table_prefix: Many published WordPress-specific SQL-injection attacks make the assumption that the table_prefix is wp_, the default. Changing this can block at least some SQL injection attacks.

    Thanks.

    you need to check your WP db prefix you dont have to check DB value

    _wp_page_template is a meta property of your page which is saved in your db. have a look at all table which used in WP are http://codex.ww.wp.xz.cn/images/9/9e/WP3.0-ERD.png

    In image you can see all name started with wp_ . ih your suggested article you need to change wp_ to xyz_ where xyz is your chosen prefix.

    You dont have to change the meta value as _wp_page_template is default keyword.

    http://jorgepedret.com/web-development/get-pages-by-template-name-in-wordpress/

    Thread Starter TangerineFrog

    (@tangerinefrog)

    Thank you for explaining that to me, Pankaj. The information in the links make complete sense—much appreciated.

    I’ll now mark the topic as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Database postmeta table prefix defaults to wp- when using theme custom page’ is closed to new replies.