Multiple posts actions

In AutomatorWP you can find some actions with the ability to work with multiple posts like the “Update multiple posts” or the “Delete multiple posts” actions.

In this kind of actions, you will be able to set the conditions to filter the posts the action will work with. Here is how the condition fields look:

Those conditions are divided in 2 groups, the field conditions, to filter by the post field value (ID, Title, Type, Author, etc) and the meta conditions, to filter by any post meta value of your choice.

To meet how those condition fields work, lets see a few examples of how to setup them.

Filter by author and type

That’s one of the most common examples and is to filter posts by a specific author and type. Here is a screenshot about how to setup this conditions:

The first condition is set as “Author is equal to {user_id}” where the “{user_id}” is a dynamic tag that will change dynamically based on the user who completed the automation.

The second condition is set as “Type is equal to product” looking to get only the posts with the type “product” (for example WooCommerce uses this type for its products).

With those 2 conditions, the action will work only with the “products” that the user who completes the automation owns so you can use a similar condition setup to update all products of this user with the action “Update multiple posts” or delete all its products with the action “Delete multiple posts”.

An example automation of this could be:

When user membership expires

Update all user posts to draft status
When a tag is removed from the user

Delete all user posts

Filter by author and date

Here is an example about how to filter old posts of a specific user to, for example, clean up old post entries. Here is a screenshot about this conditions:

The most important condition is the “Date is less or equal to 2022-01-01” that will filter the posts to the ones that have been published prior to January 1st 2022 or in this exact day.

The full date format accepted is “Year-Month-Day Hour:Minute:Second” but you can use shorter versions as “Year-Month-Day” to filter by date, “Year-Month” to filter by a year and month or even use “Year-“ if you are looking to filter only by a specific year.

Of course, you can make other combinations to filter the date like “Date contains -01-“ to filter posts published on January (without take in count the year or day) or a condition like “Date contains -15” to filter posts published the 15th of any month and any year.

Filter by post metas

The post metas covers all the custom fields that the plugins or themes adds to posts, thanks to the meta conditions, you are able to filter any post by any of those custom fields. Here is an example screenshot:

The most important to meet from a meta is its key, for example in WooCommerce, the custom field “SKU” is stored internally with the key “_sku” and other plugins uses prefixes in their meta keys like “_{plugin-name}_field”.

So, every time you want to filter posts by its metas, the most recommended is to contact to the plugin author to meet how this custom field is stored and which key uses, or use a plugin to reveal the post metas to meet all the meta keys and their values of a post.

Combine filters (post fields and metas)

Of course, you can combine multiples conditions to the post fields and metas and the action will filter the posts based on all the conditions configured, without limit. Here is an example screenshot: