Hey ma, check out my new database!

WordPress FSE post_type Content Types

If you’re working with WordPress Full Site Editing (FSE), you’ll eventually discover that much of the magic is stored in the wp_post table of the database. Identify what is stored in the table relevant to FSE by the value of the post_type column.

Use the following SQL to return a list of the unique post_type values. It may help you to determine whether your template parts, etc., are being store in the db, along with other values. I find it useful.

         SELECT ID, 
         ROW_NUMBER() OVER(PARTITION BY post_type ORDER BY ID DESC) unique_type
             FROM wp_posts
       ) a
WHERE unique_type = 1
ORDER BY post_type ASC;

Decide what content you want to review from the results of that query (e.g. are you looking for a template-part you’ve customized?). Use the the following SQL to dig deeper. For example, from this query you might copy paste the template-part content for migration purposes. As you’ll see from the results after executing the SQL above, you have several options other than template-part. I’m suggesting template-part as that is relevant to FSE, and might be something you’ll benefit from querying. Say that five times, fast. Then run the following SQL:

SELECT ID, post_type,post_name,post_content FROM wp_posts 
WHERE post_type = "wp_template_part"
ORDER BY post_name ASC;

Tweak the SQL however you wish. Maybe you want to see more than the four columns I’ve included here. What do I care? I do care! I care about you. Awww…

Happy hunting!

Whatchu do

Leave a Reply

Your email address will not be published. Required fields are marked *