Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

Thank you!

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
    
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 J. Hansen Jun 3 '12 at 5:47
    
@Sarathi I have updated my answer, use WP_SITEURL and WP_HOME constants for it. –  Eugene Manuilov Jun 3 '12 at 5:51
    
That works perfectly, thank you for all of your help! –  Sarathi J. Hansen Jun 3 '12 at 5:57
add comment

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.

share|improve this answer
    
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 J. Hansen Jun 3 '12 at 5:51
    
@Sarathi looks like I misunderstood your question. Glad you got an answer. :) –  its_me Jun 3 '12 at 6:28
    
That's fine, I'm not always great at explaining myself. But thanks for your response. :) –  Sarathi J. Hansen Jun 3 '12 at 7:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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