0

Imagine three websites focusing on different topics: geography, biology, political science. One website has a page (mysite/alaska) that discusses the geography of Alaska. The second site has a page (mysite2/alaska) that discusses Alaskan wildlife, and so on.

Now imagine a fourth website with a page at mysite4/alaska that has an article about Alaska that consists of the content from the other three sites.

In other words, the content from mysite/database, mysite2/database and mysite3/database is simply strung together to form a super article.

This is something I've been working with on a site that I want to convert to WordPress. I suspect it will be too complex and problematic, and, in the long run, it might be best to just create four different WordPress sites and manually copy the database entries from the first three sites into a super article.

But I wanted to ask if there is a relatively clean way of accomplishing this.

I envision sort of a template or master page that simply includes content from other databases, similar to this...

<include mysite1-database/alaska>
<include mysite2-database/alaska>
<include mysite3-database/alaska>

I might add that I've found a simple way of customizing the content using CSS. If I have a paragraph that I want to appear in mysite2 but not in the super article, I can simply give it a class "NoDisplay" that is set to display: none in the super article.

  • Have you considered using a multisite install instead? It would simplify things a lot – Tom J Nowell Jun 4 '17 at 3:44
  • I've been reading up on that. It sounds like there are a lot of pros and cons, and some recommend ManageWP instead. However, I think MultiSite might be the best solution for this particular project. A multi-site installation could also handle all the associated subdomains, right? – WordBear Jun 4 '17 at 3:59
  • Yes, for everything else there's domain mapping. ManageWP is just a tool/service – Tom J Nowell Jun 4 '17 at 14:30
2

If the content to import is in another database that you have access to (via custom programming), then it is technically possible to extract data from the source database and create pages/posts from that data/content into your WP site.

See my answer to Automating Page Creation . The link to https://developer.wordpress.org/reference/functions/wp_insert_post/ contains the WP code needed to create a page/post.

If the program was smart enough to only grab 'new' data (assuming that the source data had a 'publish-date' type field), then you could run a WPCron job to periodically grab 'new' data. Your program would check to ensure that the content wasn't previously created by a previous WPCron job.

Customize programming needed, with data access to the source data. But, technically possible, IMHO.

Good luck!

Your Answer

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

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