Where Does Bricks Builder Store Page Content?

Answer: In the wp_postmeta table. The meta name where content is stored at the moment (as of Bricks 1.7.3) is _bricks_page_content_2

Just thought it would be nice to have a search engine indexed answer to this question, as the answer didn’t come up readily when I was looking for it. In my case I was trying to export Bricks pages via WP All Export, and only getting the Gutenberg page content.

Hope that helps someone!

2 Likes

Strange, doesn’t come up in my Bricks install.

You need to search by meta_key, not meta_value. Instead of =, is there a like option?

With raw SQL, you can find it with the following code.

SELECT * FROM `wp_postmeta` WHERE `meta_key` = '_bricks_page_content_2';

Alternatively, find all bricks meta keys with the following raw SQL code:

SELECT DISTINCT ``meta_key`` FROM ``wp_postmeta`` where meta_key LIKE '%bricks%';

In addition, the Bricks page content is stored in JSON format. So if you find a bunch of gibberish inside of nested curly brackets, you’ve probably found your Bricks data.

Found them.

As serialized data, correct?

I’m not looking at it right this moment, but yes, I am 99% sure it is serialized.

I need to render conditionally a brick element only if the page has bricks content data.

1. I tried in element’s condition these:

{echo:get_post_meta({post_id},'_bricks_page_content_2')}
!=
false
{echo:get_post_meta(get_the_ID(),'_bricks_page_content_2')}
!=
false

Nothing works.

2.Then i created a PHP function and then use it in condition:

function bu_post_has_bricks_content_data($post_id = null) {
	if (empty($post_id)) {
		$post_id = get_the_ID();
	}
	$bricks_data = get_post_meta($post_id, '_bricks_page_content_2');
	return empty($bricks_data) ? false : true;
}

and use in condition

{echo:bu_post_has_bricks_content_data()} != false

This works!

3. Is possible to have this witohut creating a PHP function ?

I’m wondering if it’s possible to do it. Using element’s condition.

Great question! I don’t think so. I had the same question recently, and came to the same conclusion you have. I don’t think you can use arguments in the functions you call with the echo dynamic data. (Correct me if I’m wrong, someone.)

This is still a work in progress, but here’s a how-to blog post about this very use-case you are looking into.