Title: Change postmeta from database
Last modified: March 27, 2020

---

# Change postmeta from database

 *  [NoEscape](https://wordpress.org/support/users/olivianbusaga/)
 * (@olivianbusaga)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/)
 * Hi,
    I have 3 websites connected to a single database and i need to duplicate
   and change postmeta table from database for customize seo part for each website.
 * can anyone help me with this thing?
    can you tell me in which file the wp_postmeta
   table is specified so you can modify it with wp_postmeta2 copy?
    -  This topic was modified 6 years, 1 month ago by [NoEscape](https://wordpress.org/support/users/olivianbusaga/).

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/#post-12593299)
 * It’s not as simple as altering a file. You should not alter any files anyway.
   Table names are set as class properties when the $wpdb object is instantiated.
   The postmeta tables should only vary by their prefix. You can alter which prefix
   is used with the global $wpdb object’s `set_prefix()` method. This in effect 
   changes which site PHP is connected to.
    [https://developer.wordpress.org/reference/classes/wpdb/set_prefix/](https://developer.wordpress.org/reference/classes/wpdb/set_prefix/)
 * In what way do you want to duplicate and change each site’s table? Unless every
   site is a prefect clone of the other, duplicating tables between sites is not
   feasible because the post IDs are all different. What ever you do, test thoroughly
   on a small subset first and backup everything before attempting any changes.
 *  Thread Starter [NoEscape](https://wordpress.org/support/users/olivianbusaga/)
 * (@olivianbusaga)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/#post-12594532)
 * More precisely I would like to have the same content on all 3 websites but the
   seo part should be independent, for example when I do the seo part on the home
   page I will not have the same seo content and on the other 2 websites.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/#post-12595323)
 * I don’t know what you mean by same content but with independent SEO. It doesn’t
   matter to me anyway. IMO, we should always avoid redundant data and your scheme
   is contrary to that. You may do as you wish though. Be careful though, search
   providers have been known to de-rate pages when it it sees the same content on
   multiple sites.
 *  Thread Starter [NoEscape](https://wordpress.org/support/users/olivianbusaga/)
 * (@olivianbusaga)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/#post-12595373)
 * what solution would I be able to separate the key phrases and meta description
   for each website?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/#post-12598575)
 * One possibility that comes to mind would be to utilize one WP installation to
   serve multiple domains. This can be done with some code in wp-config.php that
   dynamically sets the WP site and home URL values. The theme templates would alter
   what they output based on the requested domain. For example, a different site
   logo is output for each domain. Unique key phrases can be dynamically inserted
   into post content by way of shortcodes or custom blocks, similar to how word 
   processor mail merge works.
 * This way, should you want to change the common “boilerplate” data, it only needs
   to be done in one place instead of on multiple sites. Meta data, depending on
   how extensive it is, could be stored separately under keys uniquely defined for
   each site, or together under a single key as an array of data, or if meta data
   is extensive, a custom table with a different column for each site.
 * This is going to require more up front coding effort, but it’ll pay back into
   the future by giving you a more maintainable, efficient, scalable site in the
   long run.

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

The topic ‘Change postmeta from database’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [phpmyadmin](https://wordpress.org/support/topic-tag/phpmyadmin/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/change-postmeta-from-database/#post-12598575)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
