Posted on

Can 2 WordPress Websites Share 1 WP-Content Folder?

YES!

There are a number of benefits to sharing the WordPress content folder; Both websites will have access to the same themes and plugins. This means that both sites could use a single theme, allowing an easily manageable identical look for two domain names. Media files are saved to the same location, but appear separate in WP. This makes backing up easier.

To accomplish this you need to rearrange things and create symbolic links that go from the old wp-content location to the new shared location. Because I like you, I wrote this quick PHP script to make it easy for you. Simply update the $folderA and $folderB variables to whatever your names are. Then upload the file to your website and run the script in your browser: http://yourwebsite.com/symlink.php. Then delete the file once you are done.

Download the Script

<?php // This script creates two symbolic links that allow two WordPress sites to share one common wp-content folder
 
// Rev 07-06-17
error_reporting (E_ALL);
ini_set ('display_errors', TRUE);
 
// Website A folder name
$folderA = 'mywebsitefolder'; // Existing Website

// Website B folder name
$folderB = 'newsitefolder'; // New website to share content

// Shared content folder name
$content = 'wp-content'; // (at same level as website folders)

// Build paths
$websiteA = $_SERVER['DOCUMENT_ROOT'] . '/' . $folderA;
$contentA = $websiteA . '/wp-content';

$websiteB = $_SERVER['DOCUMENT_ROOT'] . '/' . $folderB;
$contentB = $websiteB . '/wp-content';

$contentShared = $_SERVER['DOCUMENT_ROOT'] . '/' . $content;

// Check if the paths are good...
if( is_dir($contentA) AND is_dir($contentB) ) { //
 
 // Rename the original wp-content folder
 $contentB_Saved = $contentB . '_SAVED';
 if(!rename($contentB , $contentB_Saved) ) { exit('Error: Website B wp-content could not be renamed. Aborting...'); }
 
 // Move WebsiteA's wp-content to root
 if(rename($contentA , $contentShared)) {
 
 // Make the symlinks
 if(symlink($contentShared, $contentA)) {
 
 echo "<p>Symlink A Created: $contentA<br />---&gt; $contentShared</p>";
 
 if(symlink($contentShared, $contentB)) {
 
 echo "<p>Symlink B Created: $contentB<br />---&gt; $contentShared</p>";
 
 echo '<p>' . readlink($contentShared) . '</p>';
 
 exit('Success :-) ');
 
 } else {
 
 exit('Symlink B Could Not Be Created :-(');
 }
 } else {
 
 exit('Symlink A Could Not Be Created :-(');
 }
 } else {
 exit('wp-content could not be copied to root :-(');
 }
} else {
 exit('Directory Read Error :-( ' . $contentB);
}

?>

 

Posted on

WordPress Plugin – EE Contact Form

EE Contact Form is a simple yet solid email contact form system. This is not a custom form maker. There is a limited set of text input fields, which you may choose to show, require and change the default label.

There is also an option for including a file with the message, spam and word filtering options, and full control over who receives the mail, including CC and BCC capability. Extra effort has gone into reducing contact form spam and external tampering.

I’ve built this plugin primarily for my own use. Its straightforward setup, simple flexibility and difficulty for spambots to abuse makes me look good to my clients.

This website uses EE Contact Form. Try it out by sending me a message!

InstallationPackageIcon - Zip

To install, simply upload the plugin zip file to your WordPress website and activate it. Configure the simple settings in the new menu that will appear in your sidebar. Explanations of each feature accompany the inputs.

To add the plugin to your website, simply add the shortcode found on the main configuration page.

Customization

Styling over-rides are very simple as well and this plugin attempts to let your existing site’s styles do much of the work.

After first activation, the database will contain a single new row in the options table, option-name: [[eeContactForm]], containing a short pipe delimited string to store the plugin settings.

Frequently Asked Questions

Q: Why did you go and build another contact form?

A: To be honest, I have developed this for use on the many websites I manage. I could not find a plugin that suited me, so I made my own.

Q: What if I have trouble? Will you help?

A: Yes, to the very best of my ability. Please contact me with any issues: [email protected]

Q: Can I customize the look?

A: Yes, the CSS is easily over-ridden, making it easy for anyone with CSS knowledge to customize the page design.

Q: Can I customize the function of the system?

A: Yes, you are free to modify the PHP. The coding is commented well, so it should be easy to figure out what’s going on. Contact me with questions.

Q: What is the maximum upload file size?

A: This is a setting that you choose in the file configuration. The initial default is 10Mb. The absolute maximum size will depend on your hosting setup. which is automatically detected.

Download the Plugin

This is a beta release and not yet published on WordPress.org. Come back here for new versions until then.

DOWNLOAD IT HERE