Bespoke plugin for importing content to multiple sites

I’m looking for some help in how to go about creating a plugin.

The situation is – I have a network of WP sites that a publish content to.

The content is CTPs so I can’t use my normal management tool (ManageWP) to publish it to the network.

Instead, I export an XML from a master site (using import/export plugin) and then add it to each site in the network individually.

Was would be better is if I could export the XML once, add it to a plugin and then publish the plugin to all the sites in the network (which I can do through ManageWP).

What’d I like is when the plugin is updated, it bring in the new content just like the import/export tool.

Any ideas on how I could achieve this would be great.

  • aristath
    • Recruit

    Hello there @yellowjersey,

    I would advise against such an implementation with XMLs.

    Instead you can simply read all posts one by one from the “master” blog and then create the post on other blogs.

    You can take this plugin as an example of how to copy posts: this copies a post from a blog to the same blog (it just clones a post) but you can use it as a template to see what functions are used to copy hings.

    I hope that helps!



  • yellowjersey
    • WPMU DEV Initiate

    Hey Ari thanks for getting back so quick.

    What would be the issue with XML? It works fine now using the export/import tool it’s just time consuming.

    The plugin you suggested would work but would still take me just as long I think?

    What I am after is a way of getting the content out of one site (master site) and then into multiple sites all at once.

    So my idea was to get the content into a plugin which I can then publish to all my sites using ManageWP.

    ManageWP offers the ability to publish posts or pages to multiple sites. Just not CTPs which is what I need.

  • aristath
    • Recruit

    The issue with the XML plugin you’re describing is that everytime the content changes you’d have to rebuild the plugin with the new XML data.

    Using it like I described above would be a lot more modular and in the long run it should save you lots of time…



Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.