WordPress.org

Ready to get started?Download WordPress

Forums

Slideshow
[resolved] mass search and replace (4 posts)

  1. Atlanta
    Member
    Posted 1 year ago #

    Hi, I am testing your plugin on a multi site set up. I have this code in a text slide

    <div style="background-image: url(../image1.png); height: 400px; width: 500px; border: none;">Well hello there</div>

    and I want to do a mass search and replace of every time it occurs and swap it out with

    <div style="background-image: url(../someotherimage2.png); height: 500px; width: 500px; border: none;">Well goodbye there</div>

    I see from this post http://www.hongkiat.com/blog/how-to-search-and-replace-wordpress-in-blog-post/ that I would do something like this in phpmyadmin

    UPDATE wp_posts SET post_content = REPLACE (
    post_content,
    'Item to replace here',
    'Replacement text here');

    but I am displaying the slideshow in an admin dashboard widget http://wordpress.org/extend/plugins/dashboard-widget-sidebar/. So how do I do it?
    I backed up my database before hand.

    Thanks

    http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/

  2. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    The table that stores the slideshow's slides is the 'wp_postmeta' table. The 'meta_value' column stores the slide data. This would make your query look something like this:

    UPDATE wp_postmeta SET meta_value = REPLACE (
        meta_value,
        'Item to replace here',
        'Replacement text here'
    );

    Best regards,
    Stefan

  3. Atlanta
    Member
    Posted 1 year ago #

    Thanks. Is there an issue with serialized data breaking with this slideshow widget if I do a search and replace?

  4. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    When looking at the serialized data in PHPMyAdmin, it looks like it won't be that much of a problem. If the replace query doesn't match any records, you won't have any results anyway. You can use an online PHP serializer to check if there will be any complications with your data.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.