WOLF - WordPress Posts Bulk Editor and Manager Professional

Set WordPress Post Titles from Custom Field Values in Bulk

To set the post title from a custom field in WordPress for hundreds of posts, you need an editor that reads each post's own data while it writes. The Bulk Edit tab of WOLF does that with variables: {TITLE}, {ID} and {meta:key} are replaced per post when the operation runs. One of them, {meta:key}, has a limit that surprises almost everyone who tries to combine it with other text, so this page covers what works as it is, why {meta:key} empties titles in some cases, and how to add your own variables, such as a publish date or several custom fields in one title, with a short filter.

The variables available in Bulk Edit

Every text field of the Bulk Edit tab (title, content, excerpt, slug, password, and the text meta fields you enabled as columns) has a variable drop-down that inserts the built-in variables, and a behavior drop-down: append, prepend, new or replace. Note that append is the first option and therefore the default; to replace the whole value, choose new. The replace behavior, which swaps one piece of text for another, is covered in bulk search and replace in posts.

VariableReplaced with
{TITLE}The current title of the post
{ID}The post ID
{MENU_ORDER}The menu order of the post
{meta:key}The value of the meta field key, with the restrictions described below
{DO_STRING_UP}, {DO_STRING_DOWN}The current value of the edited field in upper or lower case
{DO_STRING_TITLE}, {DO_STRING_UP_FIRST}The current value with every word, or only the first letter, capitalized

Variables are case-insensitive. {TITLE}, {ID}, {MENU_ORDER} and {meta:key} also work when you type them into a cell of the Posts Editor table; the {DO_STRING_...} ones work only in Bulk Edit. With these, {TITLE} - {ID} in the title field with the behavior new already makes duplicate titles unique, and {DO_STRING_TITLE} with new capitalizes every word of every title.

Set the post title from one custom field

When the title should become exactly the value of one field, for example a property reference or a product name kept in an ACF field, the built-in variable is enough:

  1. Find the meta key. In the Meta Fields tab, enter the ID of a post that has the field filled under Get meta keys from any post by its ID and click Get. ACF stores a field under its field name, so an ACF field City named city is the key city. Keep the key in the list and click Save meta fields: {meta:key} only reads keys that WOLF knows, that is its own columns and the keys saved in this tab, and returns an empty value for any other key.
  2. Select the posts: tick a few rows for a test, or use the Filters tab for a whole group.
  3. In the Bulk Edit tab, tick the title field, type {meta:city}, choose the behavior new and click Do Bulk Edit.

The same works for any text field, for example the excerpt, and for copying one meta field into another, which the FAQ on copying data from post meta fields describes.

Why {meta:key} wipes the rest of the text

The built-in {meta:key} does not insert a value into the text around it. When WOLF finds {meta: anywhere in the value, it takes the text after the first colon in the value, up to the next colon, as the key and replaces the whole value with that field. Text before the variable is dropped. Text after it becomes part of the key, the key no longer exists, and the result is empty. With the behaviors append and prepend, the current title becomes part of the same value, so it is lost as well.

For a post titled Ferrari whose field city holds Rome:

Bulk Edit inputBehaviorResult
{meta:city}newRome
{TITLE} - {meta:city}newRome
{meta:city}appendRome
{meta:brand}{meta:object}newempty
[youtube-feed single="{meta:sby_id}"] in the contentnewempty
{meta:city} on the title Review: Ferrariappendempty (the colon in the title breaks the key)

Empty results are saved like any other value, so a run like this leaves posts without titles or content. Use {meta:key} only when it is the entire value of the field. For anything else, use your own variable as shown next.

Combine custom fields, dates and text with your own variables

After the built-in variables are replaced, every value passes through the filter wpbe_apply_string_replacer, which receives the value and the post ID. Whatever your function replaces there is what gets saved. The following code adds two variables: {DATE} for the publish date, and {CF:key}, which inserts the value of any custom field at its place in the text and can be used several times in one value.

/*
 * WOLF: extra variables for text fields in Bulk Edit and in table cells.
 * {DATE}         - publish date of the post, e.g. 2026-05-01
 * {CF:meta_key}  - value of the custom field meta_key of the same post
 * Child theme functions.php or a code snippets plugin.
 */
add_filter('wpbe_apply_string_replacer', function ($val, $post_id) {
    if (!is_string($val)) {
        return $val;
    }

    // {DATE}: publish date of the post
    if (stripos($val, '{DATE}') !== false) {
        $val = str_ireplace('{DATE}', get_the_date('Y-m-d', $post_id), $val);
    }

    // {CF:meta_key}: value of that custom field of the same post
    if (stripos($val, '{CF:') !== false) {
        $val = preg_replace_callback('/\{CF:([^}]+)\}/i', function ($m) use ($post_id) {
            $meta = get_post_meta($post_id, trim($m[1]), true);
            return is_scalar($meta) ? (string) $meta : '';
        }, $val);
    }

    return $val;
}, 10, 2);

Now the same post gives these results:

Field and inputBehaviorResult
Title: {TITLE} - {DATE}newFerrari - 2026-05-01
Title: - {DATE}appendFerrari - 2026-05-01
Title: {CF:brand} {CF:object}newFerrari pitwall
Title: ({CF:city})appendFerrari (Rome)
Content: [youtube-feed type="single" single="{CF:sby_id}" layout=list]newThe shortcode with each post's own video ID

What to know about the code:

  • {CF:key} reads the field directly with get_post_meta(), so the key does not have to be added in the Meta Fields tab.
  • It inserts the value as stored in the database. An ACF date picker field gives 20260501, not a formatted date; a field that stores an array (checkboxes, multi-selects, galleries) gives an empty string.
  • Do not put {meta:...} in the same value: the built-in variable runs first and wipes the text before your variables are reached.
  • For a different date format, change 'Y-m-d' to any PHP date format, for example 'F j, Y'. Month names are written in the admin language of the user who runs the operation.
  • The variables also work in the cells of the Posts Editor table, because typed cell values go through the same function.

Test on a few posts, then run on all

A wrong title operation on thousands of posts is easy to start and tedious to undo by hand, so check it on a sample first:

  1. Tick two or three posts in the table, including one with a colon or quotes in its title and one where the custom field is empty. Ticked posts take priority over the filter, so only they are changed.
  2. Run the operation and check the titles in the table and on the front end.
  3. If something is wrong, revert the operation in the History tab, adjust the input and try again.
  4. Before the full run, filter out the posts where the field is empty: once a text field is enabled as a column in the Settings tab, the Filters tab offers NOT Empty for it. Otherwise those posts get titles like Ferrari ().

Changing the title does not change the slug of published posts; WordPress keeps the old URL. If the slugs should follow the new titles, see copying the post title into the slug field.

Checklist

  • The behavior is new when the input should replace the value, append or prepend when it should be added.
  • {meta:key} is used only alone, and its key is saved in the Meta Fields tab.
  • Text combined with field values uses your own variable such as {CF:key}, with the filter code active.
  • The test run on ticked posts gave the expected titles, and History holds the operation in case it needs reverting.

If a variable still produces an unexpected result, post the exact input, the behavior and an example post on the WOLF support forum.