[HELP] Find and Replace Wordpress phpMyadmin wp_postmeta, meta_value, repeatable_fields

momomesh

Active Member
298
80
28
2019
2,065
as the title explains,
need help from the coding gods on how to "find & replace" link / text that's in the wordpress's wp_postmeta, meta_value,

it's a repeatable_field,
I've tried using the following codes:

update wp_postmeta set meta_value = replace(meta_value, 'test_link1', 'test_link2');

but after updating in phpmyadmin "sql" section,
the link has been successfully updated,

but when you go to the link it's MISSING?!
help anyone who can point me in the right direction in changing the codes I'm using?
 
11 comments

Hyperz

Active Member
2,338
373
83
2009
2,195
You'll need to include more info because from your post it's impossible to tell what's going on. Maybe take a screenshot of the wp_postmeta table before and after running the query. And IDK what you mean by "the link". What link? Where?
 

momomesh

Active Member
298
80
28
2019
2,065
really sorry for the misunderstanding,
gonna make this as simple as possible,

my streaming site is using dooplay theme,
and in the dooplay wordpress theme each post, there's an area where we can to insert our "embed codes" as follow:

find-and-replace-1.png


I'm just trying to find a way to use "find and replace" with phpmyadmin, as when streaming hosters go down I can find and replace thousands of links in the fly, but the problem lies where the links are located, it's located in the wp_postmeta => meta_value => repeatable_fields, as I have download the wp_postmeta as below:

find-and-replace-4.png



therefore I tried using the following mySql codes:

update wp_postmeta set meta_value = replace(meta_value, 'https://openload.co/testurl1.mp4', 'https://mixdrop.co/newlink');

find-and-replace-3.png

the results return that I have successfully changed 1 row! yeepee,
but when I return to the post that had that link, the link DISAPPEARS!? as follow:

find-and-replace-2.png


I have used the codes in the above to find and replace text, link in the wp_content database before and it always works, it's just that embed links in the "Video Player" just can't be find and replace.

hopefully you get what I'm saying~
 

javgg.eu

Active Member
28
6
3
2020
1,585
i've done this the only workaround i came up is to run the exact code as the dooplay, I'm not sure if there's a work around with sql query


Code:
$arr = array(  
    array ( "name" => "Server", "select" => "iframe",  "idioma" => "",  "url" => "iframe link" )
                    );

    update_post_meta( $id, 'repeatable_fields', $arr );

this will output as the json value for repeatable_fields

if you replace the repeatable_fields with json code,
then that json code will turn it again as json code which make it unreadable for repeatable_fields
 

momomesh

Active Member
298
80
28
2019
2,065
i've done this the only workaround i came up is to run the exact code as the dooplay, I'm not sure if there's a work around with sql query


Code:
$arr = array( 
    array ( "name" => "Server", "select" => "iframe",  "idioma" => "",  "url" => "iframe link" )
                    );

    update_post_meta( $id, 'repeatable_fields', $arr );

this will output as the json value for repeatable_fields

if you replace the repeatable_fields with json code,
then that json code will turn it again as json code which make it unreadable for repeatable_fields
it hurts so much to find out abut there technical hiccups once you've invested in 50k links to know you can't find and replace them in mass,

it's a simple thing to ask really sucky man, that's why they say wordpress is a fucked up!
imagine if you database goes up to 150k links, your whole database sql will LAGGG.
Post automatically merged:

i've done this the only workaround i came up is to run the exact code as the dooplay, I'm not sure if there's a work around with sql query


Code:
$arr = array( 
    array ( "name" => "Server", "select" => "iframe",  "idioma" => "",  "url" => "iframe link" )
                    );

    update_post_meta( $id, 'repeatable_fields', $arr );

this will output as the json value for repeatable_fields

if you replace the repeatable_fields with json code,
then that json code will turn it again as json code which make it unreadable for repeatable_fields

how do I apply the codes you gave into the phpmyadmin panel? just paste it in the sql?
how do I find and replace?
 
Last edited:

momomesh

Active Member
298
80
28
2019
2,065
Do you find solutions ??
I got sent the solution but I haven't tried it out yet since I found a work around that didn't use the theme's own, video player custom field. If you want it you can PM me, it using 2 plugins to do the work but I haven't tried it out myself.
 
Top Bottom