Is there a way to setup a Wordpress site that uses another site's database but cannot write to specific tables (like wp_posts)?

Basically I'm trying to set up a testing site that I could use to test new WP versions, themes, (some plugins?), etc. Ideally this site would display the content of the live site (staying current so that constantly duplicating the database wasn't necessary). But I wouldn't want someone to be able to edit that dev site and have the change reflect on the live site.

I recognize that this means certain database tables would need to be editable while others were not.

One obvious workaround is to limit WP user permissions, and I think in my case I will either just do that or go the old-fashioned route with two separate db's. But I am curious whether this is possible or if there is some solution out there that does basically this.

  • 1
    What if the core or plugin updates needed to make changes to the database content or schema? – MikeNGarrett Feb 26 '19 at 22:41
  • @MikeNGarrett - Yea... you are probably right this is too much of a rat's nest. I had thought that making certain tables writable would be okay. But of course - presumably WP versions have an effect on the DB and not just core files? – Lime Feb 26 '19 at 22:50
  • 1
    That's right. If you look at major version releases, you'll see quite often these require some sort of database upgrade process. That's not including any changes plugins make which is far less certain. I recommend automating the migration process as much as possible. That way all you have to do is click a button when you need to test. – MikeNGarrett Feb 26 '19 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.