Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come fare ricerca e sostituzione in WordPress con un plugin

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Volete effettuare una ricerca e una sostituzione in WordPress? Recentemente, uno dei nostri utenti ci ha chiesto come eseguire la ricerca e la sostituzione sul database di WordPress senza scrivere alcun codice SQL o utilizzare phpMyAdmin. Molti principianti non si sentono a proprio agio con il codice, ecco perché abbiamo trovato un plugin di ricerca e sostituzione per WordPress. In questo articolo vi mostreremo come eseguire la ricerca e la sostituzione in WordPress.

Search and replace text in WordPress database

Come iniziare

È estremamente importante creare un backup completo di WordPress prima di apportare qualsiasi modifica al database di WordPress.

Fate di questa buona pratica un’abitudine, perché le cose possono andare storte in qualsiasi momento quando si apportano modifiche dirette al database di WordPress. Se avete un backup, potete facilmente ripristinare il vostro sito WordPress senza perdere nulla.

Installazione e utilizzo di Better Search and Replace per WordPress

La prima cosa da fare è installare e attivare il plugin Better Search Replace. Dopo l’attivazione, è necessario visitare la pagina Strumenti ” Better Search Replace per utilizzare il plugin.

Better search replace plugin settings

È sufficiente aggiungere la stringa di testo che si desidera cercare e poi aggiungere il testo di sostituzione.

Successivamente, è necessario selezionare le tabelle in cui si desidera effettuare la ricerca. Ad esempio, se si vuole cercare e sostituire del testo nei post, si deve selezionare la tabella dei post. È anche possibile selezionare più tabelle, se si desidera.

Per saperne di più sulla gestione del database di WordPress e sulle funzioni di ciascuna tabella in WordPress.

Il plugin può eseguire una ricerca e sostituzione sensibile alle maiuscole e alle minuscole. Può anche eseguire un’esecuzione a secco che consente di vedere quante celle sono interessate dalla ricerca senza sostituire effettivamente il testo.

Quando si è soddisfatti, fare clic sul pulsante Esegui ricerca/sostituzione. Se non si è selezionata l’opzione di esecuzione a secco, il plugin eseguirà la ricerca e la sostituzione sul database di WordPress.

Risoluzione dei problemi

È possibile che venga visualizzata una schermata bianca o che si verifichino timeout durante l’esecuzione di una ricerca e sostituzione. Fare semplicemente clic sulla scheda delle impostazioni nella pagina del plugin.

Troubleshooting timeouts during search and replace

Si noterà l’opzione Dimensione massima della pagina. Provare a diminuire le dimensioni della pagina per evitare timeout e schermate bianche.

Questo è tutto, speriamo che questo articolo vi abbia aiutato a trovare un miglior plugin di ricerca e sostituzione per il database di WordPress. Potreste anche consultare il nostro tutorial su come ripulire il database di WordPress per migliorare le prestazioni.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per i video tutorial su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

24 commentiLascia una risposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

    • WPBeginner Support says

      The plugin does have the ability to search what was added through other plugins, you would mainly want to make ensure you search the correct tables.

      Admin

  2. Paul G says

    Thanks, this mostly worked for me but didn’t quite change all of the image links.

    The rest I could easily change myself by editing the custom modules.

  3. Karol says

    Changed a website from http to https via cpanel; green lock did not appear and “connection is not secure” warning was present. This plugin worked great for me. The only difference I did was that I left the checkmark off “Case Insensitive?”.

    Every site can be different with it’s own hurdles to jump through but the dry run seemed to look okay without any errors so I ran with it. Green lock appeared right away for the site. Plugin worked for me. I hope it continues to work with other sites.

    My only question now is … Do I leave the Better Search Replace plugin installed and activated or do I uninstall it now that I’m done?

    • WPBeginner Support says

      That would be a personal preference question but you should be able to remove the plugin without worry :)

      Admin

  4. Mandy says

    Hello,

    My site is having issues showing images lately, and my host said that it’s because the paths are wrong. They recommended this plug in, but my problem is that I am not sure what I am searching and replacing. Here’s why:

    When I insert an image in “visual” mode within a post, it shows up. They all do.
    Then when I preview or publish, some images don’t show up. What I am noticing lately is that instead of the code showing them as “image.jpg”, they now have the image size you choose in the path – “image-300×188.jpg” (this happens to be the medium size for this particular image). Why is it putting the pixel dimensions? If none of the images worked, I could say yes, the paths are incorrect, but some images DO work! I am officially bamboozled. It seems so random.

    Best,

    Mandy

  5. Ashraf Ali says

    I am switching from http to https now the common problem faced is broken css, I am wondering if could use this plugin to replace https:// to just //

    So that all contents are delivered over https

    Cheers

  6. Drew says

    I had a program enter structured data that is all different. I want to remove everything between and including this : ———————-

    How would I do that?

    • WPBeginner Support says

      Hi Drew,

      We are not sure we completely understand your issue. However, we are guessing that you had a plugin to add structured data and now you want to remove the structured data from your WordPress posts and pages? If this is the case, then you can simply uninstall the plugin.

      Admin

  7. Sueli says

    Great plugin!

    I have a question.
    Can I use a wildcard?

    I am trying to remove numbers added after an image file. They are different (both the numbers and their length). The stop point would be the (“).

    Some examples of what I want to replace with (jpg”)
    (jpg?11906004322295206140″)
    (jpg?15231215847335105667″)
    (jpg?82668654789154738″)

    Is it possible with this plugin?

    Thanks

  8. David says

    I download “Better Search & Replace. Once it found entries, it doesn’t show me unless I buy premium addon.

    So instead I ditched that and downloaded “Search & Replace”. It took me only two minutes to replace 100 entries.

  9. Ralpheal says

    Wow thanks so much, this is truly a luxury. Going to save me a lot of time, as I was considering changing a phone number on 1oo’s of blog posts.

    Thanks so much, :)

    Ralpheal

  10. Mike says

    This plugin did not work for me. I backed up the database, then unchecked “Dry Run”. It messed up things all over the site and there was no way to undo the changes.

    I even tried to restore the database backup I created with it before making changes and that didn’t work. Don’t use this unless you’re prepared to do an entire site restoration.

  11. vikas kumar says

    sir
    help me out from pagination error i did which you show in video but i didn’t get result
    i am using macbook air in this your given shortcode not work properly

  12. Marko Tiosavljevic says

    yes, but this plugin is practically useless when it comes to migrations.

    When you migrate website from domain . com to another . com you need to change

    you need to connect to database for changing url or you need to insert it in wp_config as url

    i am working on external app wp safe mode that is solving this problems in best way.

  13. Nico says

    Hi, it seems that this plugin is no longer available in WordPress Plugin Directory. Which alternative plugin do you recommend?

    With kind regars,
    Nico.

  14. Brian says

    Does this take into account serialize data or will it break plugins that use serialized metadata? I know of a few plugins that do this for migration purposes. If it doesn’t it could cause more problems than it solves.

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.