How to use WP All Import’s Function Editor

Let’s say you need to extract just the URL from an embed code during an import. How can you achieve this goal using the Function Editor? It’s basic PHP and it is simple.

Following this example, add a function to the Function Editor like this:

function get_link_from_embed( $code ) {
    preg_match( '/data-url="([^"]+)"/', $code, $matches );
    return $matches[1] ?? '';
}

Now you can call it like this:

[get_link_from_embed({your_field[1]})]

The name of the function is what ou call inside the field during the import, between square brackets, and then the field name in this case is used as a parameter.

Clean data, zero manual effort!