• Resolved koandj

    (@koandj)


    Hi there. I have a blog with ~200 posts but only used this on a handful of posts. Is there a SQL query I could use to figure out which ones? Or any other method?
    Can’t really remember, getting old ??

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter koandj

    (@koandj)

    something like this?

    SELECT guid, post_title FROM wp_posts WHERE post_content LIKE ‘%visib%’;

    ?

    Plugin Author Nick Diego

    (@ndiego)

    Hi @koandj,

    Thanks for reaching out. Unfortunately the only method would be an SQL query like you suggested. The query you provided looks pretty good, but all blocks with visibility controls applied have the blockVisibility attribute. I asked ChatGPT for a query, and this should work:

    SELECT ID, post_title, post_content
    FROM wp_posts
    WHERE post_type = 'post'
    AND post_status = 'publish'
    AND post_content LIKE '%blockVisibility%';

    Best,
    Nick

    Thread Starter koandj

    (@koandj)

    Thanks a lot @ndiego, I really appreciate you taking the time to find a solution.
    I recently added a couple more user profiles to the site with different permissions and I wanted to find the posts to check if they needed updating for the new roles.
    The query works, thank you very much. I only removed the post_status in case I had used this on a draft article as well and it found 1 indeed, so happy days ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.