---
title: Workflow
description: MediaPress Workflow allows you to save updates to published content without directly updating the original post until you are ready to do so.
url: https://developers.wpengine.com/docs/newsroom/mediapress/workflow/
image: https://developers.wpengine.com/og/docs/newsroom/mediapress/workflow.png
---

# Workflow

MediaPress Workflow allows you to save updates to published content without directly updating the original post until you are ready to do so.

This is achieved by creating a new draft ‘version’ of your published content, which can be worked on independently, and will override the original post when it is published.

This workflow can support various use cases. You can create an unlimited number of draft ‘versions’, work on them in isolation, decide whether or not to eventually publish them, and/or schedule them to be published in order.

This feature currently supports copy and merge of the following data:

- Post title
- Post excerpt
- Post content
- Post meta

By default, meta with the `revisions_enabled` argument set to `true` during registration will be transferred over to the draft copy ([see here for more info](https://make.wordpress.org/core/2023/10/24/framework-for-storing-revisions-of-post-meta-in-6-4/)). This is to avoid cloning inappropriate data, as revisioned meta is most likely to be related to content.

The filter `wp_revisions_meta_keys` can be used to adjust which meta is “revisions enabled”.

> **Note**
>
> Our filter `mediapress_workflow_meta_keys` can be used to further customize the values that will be transferred to a draft copy, but this filter won’t be taken into account when publishing a draft copy and overwriting the original post.

## Additional Configuration

Workflow must be activated via the “MediaPress” settings page. No further configuration is necessary.

## Filters/Actions

### PHP

#### Filters

##### `mediapress_workflow_supported_post_types`

Defines the post types on which the workflow functionality will be enabled.

**Default Value**

`[ 'post', 'page' ]`

**Parameters**

| Name       | Type  | Description              |
| ---------- | ----- | ------------------------ |
| post_types | array | Array of post type slugs |

**Usage**

```php
add_filter( 'mediapress_workflow_supported_post_types', 'my_plugin_add_workflow_support' );
function my_plugin_add_workflow_support( array $post_types ): array {
  $post_types[] = 'my_custom_post_type';
  return $post_types;
}
```

##### `mediapress_workflow_meta_keys`

Allows the adjustment of the post meta that will be cloned when a draft copy is created, and restored when a draft copy is published - overwriting the parent post values.

**Parameters**

| Name      | Type                | Description             |
| --------- | ------------------- | ----------------------- |
| meta_keys | array\<int, string> | Array of meta keys      |
| post      | WP_Post             | The current post object |

**Usage**

```php
add_filter( 'mediapress_workflow_meta_keys', 'my_plugin_workflow_meta_keys' );
function my_plugin_workflow_meta_keys( array $meta_keys ): array {
  if ( ! isset( $meta_keys['my_meta_key'] ) ) {
    $meta_keys[] = 'my_meta_key';
  }
  return $meta_keys;
}
```

##### `mediapress_workflow_taxonomies`

Allows the adjustment of the taxonomies that will be cloned when a draft copy is created, and restored when a draft copy is published - overwriting the parent post values.

This filter requires both the REST key and the actual taxonomy slug, since these may differ. e.g: `[ 'tags' => 'post_tag' ]`.

**Parameters**

| Name       | Type                   | Description                                                         |
| ---------- | ---------------------- | ------------------------------------------------------------------- |
| taxonomies | array\<string, string> | Array of taxonomy slugs and REST API keys \[ ‘rest_key’ => ‘slug’ ] |
| post       | WP_Post                | The current post object                                             |

**Usage**

```php
add_filter( 'mediapress_workflow_taxonomies', 'my_plugin_workflow_taxonomies' );
function my_plugin_workflow_taxonomies( array $taxonomies ): array {
  if ( ! isset( $taxonomies['my_taxonomy'] ) ) {
    $taxonomies['my_taxonomy'] = 'my_taxonomy';
  }
  return $taxonomies;
}
```

##### `mediapress_workflow_hide_draft_copies`

Whether draft copies should be completely hidden from the post list screen.

Default: `false`

**Parameters**

| Name        | Type    | Description                                          |
| ----------- | ------- | ---------------------------------------------------- |
| should_hide | boolean | Whether to hide draft copies from the post list view |

**Usage**

```php
add_filter( 'mediapress_workflow_hide_draft_copies', '__return_true' );
```

## Data structure

When creating a draft ‘version’ of a post, a new post will be created with the meta key `_mediapress_is_draft_copy` set to `true`.

> **Caution**
>
> For performance reasons, we query posts based on the *presence* of this meta key, so it should only be present on posts when it has been specifically set by this plugin.

Posts with this meta key are excluded from queries by default so that they remain hidden from view unless specifically requested.

Draft ‘versions’ of a post have their parent set to the original post ID which is what allows us to relate them to one another.

## Was this helpful?

Thanks for the feedback!

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://developers.wpengine.com/#website","name":"WP Engine Product Documentation","url":"https://developers.wpengine.com/","description":"Resources for developing, deploying, and scaling on WP Engine.","inLanguage":"en-US","keywords":["API documentation","product documentation","headless WordPress","managed WordPress hosting"],"publisher":{"@id":"https://wpengine.com/#organization"}}]}
```
