Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

text widget not saved WordPress

I have a wp multisite with several sites.
Each site have many widgets.

The version of this wp is 3.0.1
i upgraded wordpress to wp3.2.1
all is ok
BUT all my text widgets are disappeared.

Only the text widgets. The others are here, but the text widget are disappeared.

this is a mysterious mystery, isn't it.

Answers (4)

2011-12-19

Eli Scheetz answers:

What troubleshooting steps have you tried?

Can you add the text widget again?

is the widget in the lower section of the page called "Inactive Widgets"?

is it still saved in the database?
SELECT * FROM wp_options WHERE option_name LIKE 'widget_text'


Sébastien | French WordpressDesigner comments:

Ok... i verified : the problem is :
i change the url of the domain in the db
but i must not change this url in widget_text

How can i replace the url every where but not in widget_text
Is that possible in phpmyadmin ?

2011-12-20

Arnav Joy answers:


try following links

http://wpmodder.com/how-to-change-your-wordpress-theme-without-losing-your-widgets-or-your-composure-525.html

http://premium.wpmudev.org/forums/topic/moved-to-new-subdomain-lost-text-widgets-and-custom-header-images

http://shibashake.com/wordpress-theme/move-an-existing-blog-into-wordpress-multi-site


Sébastien | French WordpressDesigner comments:

Ok... i verified : the problem is :
i change the url of the domain in the db
but i must not change this url in widget_text

How can i replace the url every where but not in widget_text
Is that possible in phpmyadmin ?


Arnav Joy comments:

SO YOU WANT SAME VALUE FOR widget_text FIELD IN THE wp_options table after moving your site to different domain.??


Sébastien | French WordpressDesigner comments:

yes that's it.
The value don't change.
After and before moving, the value is the same.

unless you know change the value without breaking this kind f code

INSERT INTO `wpavignon_options` VALUES (90, 0, 'widget_text', 'a:36:{i:2;a:0:{}i:4;a:3:{s:5:"title";s:22:"Casque auditif Avignon";s:4:"text";s:365:"<a href="http://www.villedavignon.fr/category/protection-auditive-avignon/casques-anti-bruits-protection-auditive-avignon" style="display:block;width:239px;height:430px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2011/03/totem2010BD3.jpg) 0 0 no-repeat">Audioprothésiste Avignon</a>";s:6:"filter";b:0;}i:7;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:505:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre</a><br /></dd></dl></div>";s:6:"filter";b:0;}i:8;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:9;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small> ";s:6:"filter";b:0;}i:10;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:11;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:12;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:13;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:14;a:3:{s:5:"title";s:25:"Audioprothésiste Avignon";s:4:"text";s:329:"<a href="http://www.villedavignon.fr/centre/ville-conseil-avignon" style="display:block;width:239px;height:795px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2010/09/totem2010BD2.jpg) 0 0 no-repeat">Audioprothésiste ville conseil Avignon</a>";s:6:"filter";b:0;}i:15;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:16;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:17;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:18;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:19;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:20;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:21;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:22;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:23;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:24;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:25;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:26;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:27;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:28;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:29;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small> ";s:6:"filter";b:0;}i:30;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:31;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small> ";s:6:"filter";b:0;}i:33;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:34;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption"><strong>Fichier: </strong><a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:35;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small> ";s:6:"filter";b:0;}i:36;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small> ";s:6:"filter";b:0;}i:37;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small> ";s:6:"filter";b:0;}i:38;a:3:{s:5:"title";s:4:"Test";s:4:"text";s:332:"<a href="http://www.villedavignon.fr/category/appareils-auditifs-avignon" style="display:block;width:237px;height:748px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2010/09/totem2010BD2.jpg) 0 0 no-repeat">Audioprothesiste ville Conseil Avignon</a>";s:6:"filter";b:0;}i:39;a:3:{s:5:"title";s:26:"Téléphone 04-05-06-07-08";s:4:"text";s:0:"";s:6:"filter";b:0;}i:40;a:3:{s:5:"title";s:28:"Accessoires auditifs Avignon";s:4:"text";s:316:"<a href="http://www.villedavignon.fr/category/accessoires-auditifs-avignon" style="display:block;width:239px;height:440px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2011/03/totem2010BD.jpg) 0 0 no-repeat">ville conseil Avignon</a>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}', 'yes');
.


Arnav Joy comments:

in your old database find the value of widget_text in wp_options table using phpmyadmin

then copy this value

and in new domain again find this value in wp_options table then paste this value.

i think you are having your old db.


Sébastien | French WordpressDesigner comments:

ok but i have 100 sites in my wpmulti
if i use your method, i must cpy/paste 100 times ??


Arnav Joy comments:

see this url may be this can help you

http://wpsmith.net/tag/update_option/


Sébastien | French WordpressDesigner comments:

good link. Could you write for me the function i need please ?


Arnav Joy comments:

http://codex.wordpress.org/WPMU_Functions/update_site_option


Arnav Joy comments:

copy the value of widget_text from the old db and then use following code

$key = 'widget_text';
$value = 'paste here value some thing like this {a:4:{i:2;a:0:{}i:3;a:3:{;}}' ;

then use this function

<?php update_site_option($key, $value); ?>

Note:- Please take proper backups of your db.


Sébastien | French WordpressDesigner comments:

euh... with this method, i can update just one site at a time.
That is not what i want.
I need a method to update all my sites in one time.


Arnav Joy comments:

define this in functions.php

function update_ms_option($blogID, $option_name, $option_value) {
global $wpdb;

$wpdb->query( $wpdb->prepare( "
INSERT INTO `".DB_NAME."`.`".$wpdb->get_blog_prefix($blogID)."options`
(
`option_id` ,
`blog_id` ,
`option_name` ,
`option_value` ,
`autoload`
)
VALUES (NULL, '0', '%s', '%s', 'yes')
ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = '%s', `autoload` = VALUES(`autoload`)",
array($option_name, $option_value, $option_value) ) );





call this function no. of times as your no. of sites

$numOfMultiSite = 100; // replace this value as per your sites
$option_name = 'widget_text';
$value = 'your value of widget_text' ;

for( $i = 1; $i <= $numOfMultiSite; $i++ ) {

update_ms_option($i, $option_name , $value);

}


Note : Please take full back of everything before doing this.

2011-12-20

Francisco Javier Carazo Gil answers:

Hi Sébastien,

Have you got the dump from old installation? If you have it look for "widget_text" in the file. It should be placed in "wp_options" as Eli says.

After that, you can go to your database, and UPDATE the content of the "widget_text" saved, for the new one.

Test if some widgets depends of a plugin that have not been updated.

If you haven't saved the dump, go to DB as Eli says and look for this cell. It should be something like this:
a:4:{i:2;a:0:{}i:3;a:3:{s:5:"title";s:22:"Envíanos tu artículo";s:4:"text";s:256:"Sin necesidad de estar registrado como <a title="Autores en RDA" href="http://www.reddeautores.com/autor">autor</a> puedes enviarnos tu artículo. Empieza <a title="Env&iacute;a tu art&iacute;culo" href="http://www.reddeautores.com/enviar">aqu&iacute;</a>.";s:6:"filter";b:0;}i:4;a:3:{s:5:"title";s:22:"Suscríbete por correo";s:4:"text";s:563:"<form style="border:1px solid #ccc;padding:3px;text-align:center;" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=reddeautores', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Introduzca su dirección de correo:</p><p><input type="text" style="width:140px" name="email"/></p><input type="hidden" value="reddeautores" name="uri"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Suscribirse" /></form>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}


Sébastien | French WordpressDesigner comments:

Ok... i verified : the problem is :
i change the url of the domain in the db
but i must not change this url in widget_text

How can i replace the url every where but not in widget_text
Is that possible in phpmyadmin ?


Francisco Javier Carazo Gil comments:

Sébastien,

I recommend you the next one:
1. Do a dump of your DB
2. Delete all your DB
3. In the sql file, do a "Find and replace" with the old and the new url.
4. Import to your DB your sql modified

For me this is the simplest way to achieve it. You can also work with UPDATE and "%" but for me is less comfortable.


Sébastien | French WordpressDesigner comments:

If i do that, the url will be replaced everywhere in my db...
i can't replace the url one to one. The url appears 5500 times in the db


Francisco Javier Carazo Gil comments:

Sébastien,

In [[LINK href="http://notepad-plus-plus.org/"]]Notepad++[[/LINK]], Geany or any other powerful code editor, you can do a: "Replace all".


Sébastien | French WordpressDesigner comments:

lol... :-) I know.

But if i replace all, i replace in widget_text too...


Francisco Javier Carazo Gil comments:

Ok, Sébastien,

Sorry I thought you didn't know. You can:
1. Save "widget_text" value
2. Do a replace all
3. Update later in DB the "widget_text" field


Sébastien | French WordpressDesigner comments:

okay.....
But my question is how ?
How can i save all widget_text in one time
and update later in DB the "widget_text" field in one time...


Francisco Javier Carazo Gil comments:

Sébastien,

Try it:
1. SELECT in your DB over wp_options and save in a text file the value of "widget_text" that is placed in wp_options.
2. Later, do the dump
3. In the SQL file replace all
4. Import again
5. To finish, with phpMyAdmin update the value of widget_text

If there are any other value that you want save, do the same process. Before dump save it and in the end update.


Sébastien | French WordpressDesigner comments:

why not.
but for the 1.
HOW can i select in my DB over wp_options ?
with a code i suppose...


Francisco Javier Carazo Gil comments:

With this code:

SELECT *
FROM wp_options
WHERE option_name LIKE('widget_text');


You can also do it using phpMyAdmin or any other MySQL client like this one (is my preferred: [[LINK href="http://code.google.com/p/sqlyog/"]]SQLYog Community Edition[[/LINK]]).

Solution given by Julio is smarter.


Sébastien | French WordpressDesigner comments:

this solution select just in wp_options
so in the main site
not in others


Francisco Javier Carazo Gil comments:

Sébastien,

You want to save the value of this field ('widget_text') so you do first this SELECT and later do the dump:
0. Open phpMyAdmin.
1. Click Export in the Menu to get to where you can backup you MySql database. Image showing the export menu.
2. Make sure that you have selected to export your entire database, and not just one table. There should be as many tables in the export list as showing under the database name.
3. Select"SQL"-> for output format, Check "Structure" and "Add AUTO_INCREMENT" value. Check "Enclose table and field name with backquotes". Check "DATA", check use "hexadecimal for binary field". Export type set to "INSERT".
4. Check "Save as file", do not change the file name, use compression if you want. Then click "GO" to download the backup file.


Sébastien | French WordpressDesigner comments:

euh... this is the process to export my database ?


Francisco Javier Carazo Gil comments:

Yes, this is the process.

1. Copy value from widget_text
2. Export database
3. Replace all
4. Import database
5. Insert data saved from widget_text


Sébastien | French WordpressDesigner comments:

so i think there is a lack of understanding.
I have a multisite installation.
if i save the content of my field "widget_text" in wp_options with your code :
SELECT *

FROM wp_options

WHERE option_name LIKE('widget_text');

the content of my field "widget_text" in wp_11_options, wp_12_options, wp_13_options, wp_14_options... wp_100_options is not saved.


Francisco Javier Carazo Gil comments:

Sébastien,

That's true. The code that Gabriel provide you is the one who needs to save all this data (wp_options_old).

You create an array:

for($i=0;$i<100;$i++)
$myvalues[$i] = $wpdb->get_var( $wpdb->prepare( "SELECT widget_text FROM wp_{$i}_options WHERE option_name LIKE('widget_text')" ) );


Save the array as a file (for example, 1 row text -> 1 array value). Later you do the process and at the end you do the reverse process, load values from file to array and UPDATE it.


$wpdb->query("UPDATE wp_{$i}_options
SET field = myvalues[$i]
WHERE option_name LIKE ('widget_text' ));

2011-12-20

Julio Potier answers:

<blockquote>How can i replace the url every where but not in widget_text
Is that possible in phpmyadmin ?</blockquote>
Save the widget_text and after, replace the url everywhere with a sql replace statement. (http://msdn.microsoft.com/fr-fr/library/ms186862.aspx)
Then, restore widget_text.


Sébastien | French WordpressDesigner comments:

Julio, tu me dis de remplacer le ndd partout puis de restaurer widget_text
c'est bien ça ?
parce que justement ma question c'est comment on fait ça ?

je veux dire par là, que je sais bien remplacer l'url partout, mais par contre je ne sais pas comment la remplacer partout sauf dans widget_text.


Julio Potier comments:

Ok assuming your DB prefix is "wp_", do this :

0: Save your DB before !
<em>then</em>

1st : Save the widget_text
SELECT option_value FROM wp_options WHERE option_name = 'widget_text'
<em>Keep this in a notepad text.</em>

2nd : On each DB table
UPDATE wp_table SET field = replace(field, 'old TLD', 'new TLD') WHERE city LIKE '%old%'
<em>For each table you need to replace (TLD = NDD en français)</em>

3rd : Restore widget_text
UPDATE wp_options SET option_value='...' WHERE option_name = 'widget_text'
<em>Replace my "..." my the data from notepad, the one you kept.</em>

<strong>I think/hope this can resolve your problem.</strong>

<em>ps : C'est important de parler anglais pour que les autres puisse suivre ;)</em>


Julio Potier comments:

<em>puissent*</em>


Sébastien | French WordpressDesigner comments:

WHERE city LIKE '%old%' ???


if i have 100 sites in my wpmulti, must i do that 100 times ?


Julio Potier comments:

oups "city" = "field" and "old"/"new" are old and new TLD.

I don't think you have to do this X times / wpmulti but X times / table needed.

How many tables do you have ?


Sébastien | French WordpressDesigner comments:

J'ai 100 sites, et donc 100 fois widget_text

i have 100 sites and 100 times widget_text


Julio Potier comments:

Bad ...
In your case we can do this for the update on wp_options :
UPDATE wp_options SET field = replace(field, 'old TLD', 'new TLD') WHERE field LIKE '%old%' AND option_name != 'widget_text'

I think this is better, and point 1 and 3 became useless now.


Sébastien | French WordpressDesigner comments:

pas sur de comprendre. Ce code va agir sur tous les sites de la plateforme en même temps ?

Not sur to understand : this code will update all sites of my network at a time ?


Julio Potier comments:

Logically yes


Sébastien | French WordpressDesigner comments:

But Julio, wp_options exist only in the main site
The thers have a table like that
wp_12_options
wp_13_options
wp_14_options

your code can't update all sites...


Julio Potier comments:

Damn me ...

So you can create a routine like :

<?php
DEFINE('SHORT_INIT', true);
require_once( 'wp-load.php' );
global $wpdb;
for( $i = 1; $i <= 100; $i++ ) {
$wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'old TLD', 'new TLD') WHERE field LIKE '%old%' AND option_name != 'widget_text' );
}
?>


Put this in a file at WordPress root (near wp-load.php so)


Sébastien | French WordpressDesigner comments:

ouep
ou alors je change l'ancienne url par la nouvelle, dans toute la db
et ensuite je fais une routine dans function.php pour remettre l'ancienne url dans widget_text...
:-)
------------
yes, or i update all my db with the new url
and in function.php i create a routine to change the new url by the old url in widget_text
:-)


Julio Potier comments:

A revert solution yes ;)


Sébastien | French WordpressDesigner comments:

Julio, just one thing :
with your code, in all site, i can update the url in the field "widget_text".

<?php

DEFINE('SHORT_INIT', true);

require_once( 'wp-load.php' );

global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {

$wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'old TLD', 'new TLD') WHERE field LIKE '%old%' AND option_name != 'widget_text' );

}

so if my old url is http://oldurl.com, it is updated and will become http://newurl.com

BUT in my widgets, the url is url of a sub-site.
So the url can be http://site1.oldurl.com for example and i would update it like that : http://site1.newurl.com

could i use your code like that :

<?php

DEFINE('SHORT_INIT', true);

require_once( 'wp-load.php' );

global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {

$wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'oldurl.com', 'newurl.com') WHERE field LIKE 'oldurl.com' AND option_name != 'widget_text' );

}

with this code, does the value http://site1.oldurl.com become http://site1.newurl.com ?


Julio Potier comments:

Of course yes !


Sébastien | French WordpressDesigner comments:

in my DB i replaced the old url by the new url
and now i want to change the new url by the old url only in fields "widget_text"

i have add this code in my functions.php
function recup_widget_slh() {
global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {
$sql = "UPDATE wpavignon_{$i}_options SET field = replace(field, 'oldurl.fr', 'newurl.fr') WHERE field LIKE 'oldurl.fr' AND option_name = 'widget_text'";
$wpdb->query( $sql );
}
}

add_action('admin_init', 'recup_widget_slh');

but the widgets are not reappeared

isn't my code correct ?


Sébastien | French WordpressDesigner comments:

Finally i used your method.
i create a file slh.php at the root near wp-load.php
i uploaded the db of the site to the test site.
i go to the url of the test site and i see this message
<blockquote>La page n'est pas redirigée correctement
Firefox a détecté que le serveur redirige la demande pour cette adresse d'une manière qui n'aboutira pas.</blockquote>

In the DB, i verify : nothing has changed.

I have probably a mistake. But where ?


Julio Potier comments:

It seems like a bad php loop.
Can you paste your slh.php file here ?


Sébastien | French WordpressDesigner comments:

content of slh.php


<?php

DEFINE('SHORT_INIT', true);

require_once( 'wp-load.php' );

global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {

$wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'oldurl.fr', 'newurl.fr') WHERE field LIKE 'oldurl.fr' AND option_name != 'widget_text'" );

}

?>


Julio Potier comments:

wp_{$i}_options
or
wpavignon_{$i}_options
??


Sébastien | French WordpressDesigner comments:

Bien vu !!
Cela dit même avec wpavignon ça ne change rien


well seen (??)
but with wpavignon nothing has changed


Julio Potier comments:

strange ... do a "echo" in place of "$wpdb-query" just to be sure ...
Is my for loop ok ? or it's a infinite loop !? i doubt ...


Sébastien | French WordpressDesigner comments:

i can't seen the result, i have an error page


Julio Potier comments:

Earlyer you said :
<blockquote>in my DB i replaced the old url by the new url
and now i want to change the new url by the old url only in fields "widget_text"
</blockquote>
With "field" in the query ? Are you sure the old pattern have been replaced ?

My bad, i typed "field" as example :/
Replace <em>field</em> by <em>option_value</em>


Julio Potier comments:

For wp_posts for example you have to replace old url in these fields "post_content", "post_excerpt", "guid".


Sébastien | French WordpressDesigner comments:

the code of slh.php is exactly :
<?php

DEFINE('SHORT_INIT', true);

require_once( 'wp-load.php' );

global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {

$wpdb->query("UPDATE wpavignon_{$i}_options SET field = replace(field, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE field LIKE 'ville-avignon.fr' AND option_name != 'widget_text'" );

}

?>

and the result is :
<blockquote>La page n'est pas redirigée correctement
Firefox a détecté que le serveur redirige la demande pour cette adresse d'une manière qui n'aboutira pas.</blockquote>


Sébastien | French WordpressDesigner comments:

Sorry ^^
the code is exactly
<?php

DEFINE('SHORT_INIT', true);

require_once( 'wp-load.php' );

global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {

$wpdb->query("UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'" );

}

?>


Sébastien | French WordpressDesigner comments:

Sorry ^^
the code is exactly
<?php

DEFINE('SHORT_INIT', true);

require_once( 'wp-load.php' );

global $wpdb;

for( $i = 1; $i <= 100; $i++ ) {

$wpdb->query("UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'" );

}

?>


Sébastien | French WordpressDesigner comments:

the problem : in wp-config i have :
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'NEW-URL.fr' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );


a redirection to NEW URL
but in the DB is the db of the old TLD...

if i change and replace by
define( 'DOMAIN_CURRENT_SITE', 'OLD-URL.fr' );
i haven't problem, no error message, but a redirection to the old url ^^


Julio Potier comments:

So we gonna try to do this old school style by using a manual sql connexion ^^

<?php $connection = @mysql_connect ('<strong>host</strong>','<strong>login</strong>','<strong>pass</strong>') or die('La connexion a la base de données a échoué.');
@mysql_select_db ('<strong>dbname</strong>',$connection) or die('Problème avec la base');

for( $i = 1; $i <= 100; $i++ ) {
$sql = "UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'";
$req = mysql_query($sql) or die("Erreur sql : ".mysql_error());
}


This query will replace the OLDURL by the NEWURL, but not for the widget_text.
Do not forget to replace "host", "login", "password", "dbname" ;)


Sébastien | French WordpressDesigner comments:

and a code to verify that the table exist (many $blog_id not exist, ie : 56 or 67 are deleted) and it's perfect !


Julio Potier comments:

Do not verify, just avoid to "die" ;)
$req = mysql_query($sql);


Sébastien | French WordpressDesigner comments:

in my case wpavignon_1_options doesn't exist
so i have a message :
Erreur sql : Table 'site2_bdd.wpavignon_1_options' doesn't exist
and i think that nothing happened in the db.


Julio Potier comments:

Try this :
<?php
$connection = @mysql_connect ('host','login','pass') or die('La connexion a la base de données a échoué.');

@mysql_select_db ('dbname',$connection) or die('Problème avec la base');


for( $i = 1; $i <= 100; $i++ ) {

$sql = "IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='wpavignon_{$i}_options') UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'";

$req = mysql_query($sql) or die("Erreur sql : ".mysql_error());

}
?>


Sébastien | French WordpressDesigner comments:

<blockquote>Erreur sql : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'' at line 1</blockquote>



Sébastien | French WordpressDesigner comments:

Julio,

J'ai trouvé une astuce.

Je change l'url dans toute la base de donnée et ensuite j'utilise une fonction pour remettre l'ancienne url dans les widget_text.

J'ai résolu le problème des blogs dont l'identifiant n'existe pas.

Par contre la fonction update que tu m'as donnée ne semble pas fonctionner.
ça ne change rien dans la base de donnée.

Tu peux regarder stp ?
(le prefix de la base = wp_)

function recup_widget_slh() {

global $wpdb;
global $blog_id;
$table_prefix = $wpdb->base_prefix;

$sql = "SELECT blog_id FROM ".$table_prefix ."blogs";
$blogids_list = $wpdb->get_results($sql);
//print_r ($blogid_list);
$table_blogID = array();
foreach ($blogids_list as $list) {$table_blogID[] = $list->blog_id;};



for( $i = 1; $i <= 100; $i++ ) {
if (in_array($i, $table_blogID)){
$sql = "UPDATE wp_{$i}_options SET field = replace(field, 'http://site4-xaneconcept.fr/wp-content/gallery', 'http://mairietoulouse.fr/wp-content/gallery') WHERE field LIKE 'http://site4-xaneconcept.fr/wp-content/gallery' AND option_name = 'widget_text'";
$wpdb->query( $sql );
//$result = $wpdb->get_results($sql);
} else {echo "pas de blog portant le numero ".$i."<br>";}
}

}


add_action('admin_init', 'recup_widget_slh');





---

Julio,

I found a trick.

I change the url in the whole database and then I use a function to return the old url in widget_text.

I solved the problem of blogs whose identifier does not exist.

As against the update function you gave me is not working.
does not change anything in the database.

You can look at stp?
(prefix base = wp_)

function recup_widget_slh() {

global $wpdb;
global $blog_id;
$table_prefix = $wpdb->base_prefix;

$sql = "SELECT blog_id FROM ".$table_prefix ."blogs";
$blogids_list = $wpdb->get_results($sql);
//print_r ($blogid_list);
$table_blogID = array();
foreach ($blogids_list as $list) {$table_blogID[] = $list->blog_id;};



for( $i = 1; $i <= 100; $i++ ) {
if (in_array($i, $table_blogID)){
$sql = "UPDATE wp_{$i}_options SET field = replace(field, 'http://site4-xaneconcept.fr/wp-content/gallery', 'http://mairietoulouse.fr/wp-content/gallery') WHERE field LIKE 'http://site4-xaneconcept.fr/wp-content/gallery' AND option_name = 'widget_text'";
$wpdb->query( $sql );
//$result = $wpdb->get_results($sql);
} else {echo "pas de blog portant le numero ".$i."<br>";}
}

}


add_action('admin_init', 'recup_widget_slh');


Sébastien | French WordpressDesigner comments:

afin de verifier j'ai créé un widget contenant le mot sebseb

et j'ai changé la function comme ceci


function recup_widget_slh() {

global $wpdb;
global $blog_id;
$table_prefix = $wpdb->base_prefix;

$i=53;
$sql = "UPDATE wp_{$i}_options SET field = replace(field, 'sebseb', 'remplacementdemot') WHERE field LIKE 'sebseb' AND option_name = 'widget_text'";
$wpdb->query( $sql );
//$result = $wpdb->get_results($sql);


}


add_action('admin_init', 'recup_widget_slh');


ensuite j'ai regardé si mon widget avait changé dans le blog 53
mais non il n'a pas changé.

-------
to check I created a widget containing the word sebseb

and I changed the function like this

function recup_widget_slh() {

global $wpdb;
global $blog_id;
$table_prefix = $wpdb->base_prefix;

$i=53;
$sql = "UPDATE wp_{$i}_options SET field = replace(field, 'sebseb', 'remplacementdemot') WHERE field LIKE 'sebseb' AND option_name = 'widget_text'";
$wpdb->query( $sql );
//$result = $wpdb->get_results($sql);


}


add_action('admin_init', 'recup_widget_slh');




Then I checked if my widget has changed in the 53 blog
but no it has not changed.


Sébastien | French WordpressDesigner comments:

Juste une petite rectification : ma fonction est
function recup_widget_slh() {

global $wpdb;
global $blog_id;
$table_prefix = $wpdb->base_prefix;

$sql = "SELECT blog_id FROM ".$table_prefix ."blogs";
$blogids_list = $wpdb->get_results($sql);
//print_r ($blogid_list);
$table_blogID = array();
foreach ($blogids_list as $list) {$table_blogID[] = $list->blog_id;};



foreach ($table_blogID as $i) {
$sql = "UPDATE wp_{$i}_options SET option_value = replace(option_value, 'sebseb', 'remplacement') WHERE option_value LIKE 'sebseb' AND option_name = 'widget_text'";
$wpdb->query( $sql );
//$result = $wpdb->get_results($sql);
}

}


add_action('admin_init', 'recup_widget_slh');

cela dit ça ne fonctionne toujours pas

je vois en home du site que tu as posté une reponse, mais je ne la vois pas... envoie moi la en mp eventuellement