
Loading page…
Loading page…
Loading page…
Loading page…
Clicking a Divi button with a dynamic link and landing on a 404? If the URL ends in ",%20_blank", Divi is merging an ACF link array into one broken URL. Here's why it happens and three quick ways to fix it.

If your Divi button uses a dynamic content link and clicking it sends visitors to a 404 page, check the URL in the address bar. If it ends with ,%20_blank (for example https://example.com/,%20_blank), the problem is not your page or your permalinks. Divi is reading a link array from a custom field and turning the whole array into one broken URL.
This guide explains why it happens and gives you three ways to fix it, most of which take under a minute.
%20 is an encoded space. So the real link Divi outputs is:
https://example.com/, _blank
That is two values joined with a comma: the URL and the link target (_blank means “open in new tab”).
This happens when the dynamic field is an ACF Link field (or a similar link-type field) set to return a Link Array. ACF stores that field as three parts:
url – the addresstitle – the link texttarget – _blank if “Open link in a new tab” is tickedDivi’s dynamic content expects a plain text value for a button URL. When it gets an array, it flattens it into a comma-separated string. Your WordPress dashboard still shows a clean URL, but the front end receives url, _blank. The browser treats this as a path that doesn’t exist, so you get a 404.

Divi now receives only the URL, and the button works. Because the target is no longer passed through, open your Divi button settings, go to Link → Button Link Target, and set it to In The New Tab.
If you don’t need editors to control the link title or target from the custom field, use a simple URL field type instead:
If other parts of your site rely on the full link array, leave the field as it is and convert it to a URL only when the value is output. Add this to your child theme’s functions.php or a code snippets plugin, and replace project_link with your field name:
add_filter( 'acf/format_value/name=project_link', function ( $value ) {
if ( is_array( $value ) && ! empty( $value['url'] ) ) {
return $value['url'];
}
return $value;
}, 20 );
Keep in mind that this filter applies everywhere ACF formats that field, including any template code that expects the array. If you use the array elsewhere, Fix 1 or a separate URL field is cleaner.
Divi and caching plugins can keep serving the old broken link. After applying any fix:
If you are using a different custom fields plugin or a custom meta box, check what is actually saved in the database. Install Query Monitor or temporarily output the value with:
var_dump( get_post_meta( get_the_ID(), 'your_field_name', true ) );
https://example.com/, _blank, something (an import, a form, or a custom meta box) saved the target into the URL field. Edit the field so it contains only the URL.Clicking a Divi button with a dynamic link and landing on a 404? If the URL ends in ",%20_blank", Divi is merging an ACF link array into one broken URL. Here's why it happens and three quick ways to fix it.



Whether you're just getting started or scaling fast, we've got you covered. Access helpful guidance.