3

On my local machine, I have multiple wordpress versions installed so I can test the themes and plugins I develop.

I was wondering if I could somehow create a central wp-content folder and database, which are linked to each version of wordpress, so I don't have to continually copy my projects between the them?

2

2 Answers 2

2

For wp-content folder you need to add WP_CONTENT_DIR with path to this folder to each wp-config.php file of each your sites. All of these WP_CONTENT_DIR constants should have the same path to one folder. Read more about it here: http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content

To share the same database, you just need to setup the same database settings in each wp-config.php files. Read about it here: http://codex.wordpress.org/Editing_wp-config.php#Set_Database_Name

UPDATE: To make your urls work correctly define WP_SITEURL and WP_HOME constants which will override options settings. Read about it here: http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29

3
  • Thank you, this works great. The only problem is, the database contains two values in the wp_options table: 'siteurl' and 'home' that contain the url to only one of my installs, which messes with the links on the front end and won't allow me to enter the wp-admin of my other installs. Any ideas on how to fix this?
    – Sarathi
    Jun 3, 2012 at 5:47
  • @Sarathi I have updated my answer, use WP_SITEURL and WP_HOME constants for it. Jun 3, 2012 at 5:51
  • That works perfectly, thank you for all of your help!
    – Sarathi
    Jun 3, 2012 at 5:57
0

Have you considered a WordPress Multisite Network setup? Have you considered WordPress (Multisite) Network setup? Take a look at this: http://codex.wordpress.org/Create_A_Network

A multisite network is a collection of sites that all share the same WordPress installation. They can also share plugins and themes.

The individual sites in the network are virtual sites in the sense that they do not have their own directories on your server, although they do have separate directories for media uploads within the shared installation, and they do have separate tables in the database.

3
  • I have looked into a WordPress Multisite, but that seems to allow one WordPress install to run multiple sites, rather than multiple WordPress installs having a central data storage.
    – Sarathi
    Jun 3, 2012 at 5:51
  • @Sarathi looks like I misunderstood your question. Glad you got an answer. :)
    – its_me
    Jun 3, 2012 at 6:28
  • That's fine, I'm not always great at explaining myself. But thanks for your response. :)
    – Sarathi
    Jun 3, 2012 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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