Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7733927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:07:18+00:00 2026-06-01T07:07:18+00:00

I am wanting to have the EXACT same data across two WordPress sites that

  • 0

I am wanting to have the EXACT same data across two WordPress sites that are on different domains e.g. blog.company.com and blog.business.com BUT are on the same server etc. Each have their own theme but share the same data. So if I post on one the other has also has that post.

Is this possible? It’s a client request, so please bear with the idea

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:07:19+00:00Added an answer on June 1, 2026 at 7:07 am

    I would setup 1 database for both sites. @Wyck has a concern about links stored in the database, which is valid, but a quick header.php and functions.php modification can fix that for you.

    To setup the sites to use the same data, configure the wp-config.php file to use the same database information for both.

    WP-CONFIG

    <?php 
    define('DB_NAME', 'db_name');
    define('DB_USER', 'db_user');
    define('DB_PASSWORD', 'db_password');
    
    // I'm not sure if you'll need a condition or not. If your database host URL is the same or not.
    
    $site1 = ( $_SERVER['HTTP_HOST'] != 'site1.company.com' );
    
    if ( $site1 ) {
        // site1
        define('DB_HOST', 'external-db.company.com');
    
    } else {
        // site2
        define('DB_HOST', 'internal-db.company.com');
        // define('DB_HOST', 'localhost');
    
    }
    ?>
    

    Header

    <?php ob_start('fix_links'); ?>
    

    Functions

    <?php 
    function fix_links($input) {
        // create absolute URL fixes for both domains - this only fixes the current domain. You might have to modify it being that it seems based on the subdomain as well. 
        return preg_replace('!http(s)?://(www.)?' . $_SERVER['SERVER_NAME'] . '/!', '/', $input);
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my database i have 10 records with almost exact same data , they
I'm wanting to have a strongly typed user control that accepts the class PaginatedList<T>
I have a server application that uses a lot of threads. Without wanting to
So I have this website that I'm building and they are wanting to be
I'm wanting to write a whiteboard app. I have a beginning that renders a
I am wanting to have a view table that aggregates rows from four tables.
I need to start same task on different tabs/browsers/clients at the same exact time.
I have a client that is wanting to have jquery.colorbox and wants the background
I am wanting to have a group of components that are draggable... eg.. 1
I'm wanting to have my app (on launch) load a view that I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.