Skip Navigation

[Resolved] Run Mysql query on Views' Loop Editor

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 4 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1725081

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!

#1725725

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.

#1728781

Wow. So much for it being simple! Thanks for all the info. I appreciate it.

#1729547

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.