• I have about 900 sets of 2 images which I am uploading to the media section. I want to create 900 WordPress posts that include the links to each of the 2 images in a particular set. So basically 900 of the same exact post but each post has different links to a set of 2 images. Currently I am duplicating the same post and then swapping in the links for the next 2 images for each new post then publishing. As you can see this will take too long.

    Is there a way I can upload the 2 images in a set and automatically create a post that follows a template but uses the links from the upload? Like a plugin or some coded method?

    Example:
    If I want 900 posts to say:

    – My name is [FIRST NAME]
    – My friends name is [SECOND NAME]

    The 2 name fields are different for each of the 900 posts but manually typing the 2 unique names will take too long.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Yes, it’s possible to script post creation based on some formula or template. However, it’s also possible to create a page template that generates output that appears the same as a post without the need for actual posts being created. The only difference is how these virtual “posts” are requested. You would need to somehow pass any unique terms to the page template. You might think of these passed terms as a formulaic post “title” of sorts. The simplest form might be something like example.com/greetings/?name1=Julius&name2=Claudius. Other variations are possible with a little more work, like example.com/greetings/Julius/Claudius/.

    I’m assuming the names are somehow related to image filenames, like Julius.jpg and Claudius.jpg. Other schemes are possible. It’s just that unique data needs to be defined somewhere and related to any other data needed. A variation could be storing such data in the meta data of attachment posts which are already automatically created when uploading media. Then all we need is a reference to the attachment, such as its ID or filename base.

    It makes little difference now whether script creates 900 posts or a template indirectly references 900 image pairs. But in the future, should anything need to be changed or added to these posts, it will be far easier to alter the one page template than write a new script to alter 900 posts. As far as site maintainability goes, a page template is much superior to automated post creation.

Viewing 1 replies (of 1 total)
  • The topic ‘Bulk Post Creating With Different Text’ is closed to new replies.