I have a simple question. I would like to run a MySQL query on the loop editor to change the image size in wpv-post-featured-image from "large" to "full" in dozens of Views I have set up.
To change this: [wpv-post-featured-image size="large"]
To this: [wpv-post-featured-image size="full"]
I'm not sure which table this lives in in MySQL. Can you let me know about that?
And, of course, if you wanted to type up the exact query to run, that would be helpful too.
Thanks!
Hi, the various shortcode-based contents of a View are stored in different places in the database. It is most likely in one of two places:
- in the posts table under post_content
- in the postmeta table under _wpv_layout_settings
If the featured image shortcode is added directly in the loop editor, it's most likely stored in the postmeta table in _wpv_layout_settings for this View's post ID. This information is stored as a serialized data structure, so if you run a simple find-and-replace script you'll break the serialization structure and crash the site. Use caution, and only update this value if you understand how serialization structures work. Hopefully you will utilize a find-and-replace plugin that handles serialized data automatically.
Unfortunately we don't share this type of custom replacement query here in the forum, so I don't have a cut-and-paste snippet available to deal with serialized data. That's a bit outside the scope of support we provide here in the forums.
If the featured image shortcode is part of a loop template (a Content Template placed in the loop editor), it's most likely saved in the posts table in post_content for a post of the type "view-template". This information is typically not serialized, so a simple find-and-replace should work well. Regardless, it's not a bad idea to use a plugin or find-and-replace system that works with serialized data so you can easily handle either case.
Needless to say, be sure to create a database backup before you attempt any find-and-replace directly on the database, so you can revert easily if necessary.
Wow. So much for it being simple! Thanks for all the info. I appreciate it.
Yes, unfortunately direct database manipulation is not simple when serialized structures are involved. Hopefully a third-party database manipulation tool will be able to simplify the process a bit. I'll close here but feel free to open a new ticket if needed for additional information.