Home › Forum › Problemi Vari con WP › Macro per cambiare automaticamente parte iniziale url
-
AutorePost
-
-
1 Luglio 2017 alle 11:14 #31477bacoPartecipante
Salve ragazzi non saprei bene come spiegare il problema, provo a renderlo più chiaro:
Come penso sappiate Photobucket ha cambiato all’improvviso le proprie condizioni e ora non è più possibile avere immagini hostate sul proprio sito se si ha un account free. Quindi chi aveva il proprio wordpress pieno di immagini linkate dal proprio account photobucket si trova rovinato
In pratica dovrei scaricare anni di immagini da photobucket, ricaricarle su wordpress e poi cambiare manualmente centinaia di url
Per la prima parte del lavoro non sembra impossibile. E’ possibile scaricare i vari album sul PC, e si potrebbero riversare tutte le immagini con i loro nomi originali in WordPress in cartelle con lo stesso nome di quello che avevano su photobucket, a quel punto basterebbe solo cambiare la parte iniziale dell’URL
per dire
iiiii.photobucket.com/albums/m5/bacophotobucket/News/logonews.jpg
potrebbe diventare
baco.com/wp-content/uploads/bacophotobucket/News/logonews.jpg
Ora mi chiedo, è possibile usare qualche macro (magari nel file fuctions?) che possa cambiare automaticamente la parte iniziale dell’url? Ossia che cambi iiiii.photobucket.com/albums/m5/ in baco.com/wp-content/uploads/ ?
Non saprei neanche cosa cercare su google, se riusciste a darmi qualche hint su cosa sto cercando ve ne sarei grato!
Se ci fosse qualche macro che automatizza il cambio della sola parte iniziale dell’URL avremmo risolto il problema, sperando ci sia.
-
1 Luglio 2017 alle 12:28 #121729SteveAglAmministratore del forum
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
cambi quello che vuoi nel DB anche usando regex, scegli la tabella o le tabelle dove cambiare (inq uesto caso direi nella tabella post, puoi fare un test a freddo che ti mostra quello che cambierebbe senza farlo.
Ovviamente prima backup di ogni cosa e verifica che i backup siano ok.
-
1 Luglio 2017 alle 12:36 #121730bacoPartecipante
Grazie mille! Non ho capito una cosa, una volta utilizzato posso cancellare il plugin o devo lasciarlo per sempre? Nel senso modifica gli url ogni volta in tempo reale o definitivamente?
-
1 Luglio 2017 alle 16:49 #121731SteveAglAmministratore del forum
NON è un plugin di WP ma una applicazione da metere nelle dir principale di WP in una SUA cartella, volendo poi è in grado di autocancellarsi. Suggerisco di usare una directory con un nome stranissimo es:qwern34859 e quindi ul tutto sarà richiamata da http:/www.nomedeltuisot.cit/es:qwern34859. Lasciarlo disponibile aal “mondo” non è per nulla una buona idea è anzi pericoloso una volta finitor di usarlo se tutto è ok cancellarai la dir ed il suo contenuto. Sulla pagina linkata c’è scritto tutto questo… suggerisco di leggerla ATTENTAMENTE!!!
-
4 Luglio 2017 alle 23:11 #121735bacoPartecipante
Ha funzionato perfettamente, grazie mille veramente
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.