Some time condition arose to replace a string from Joomla article. So for example let’s suppose if you want to update the images path from each of you article page. Or let’s assume if you want to replace “/templates/MyTemplate/images/” with “/templates/MyTemplate/products/images/”.
One option you have is by opening each article under admin and update images path manually (which is actually bad and time consuming idea). The other and most appropriate option is using an SQL command to replace string in a single shot.
Before continuing to read this post and executing replace command in SQL, I will suggest DON’T FORGET TO BACKUP YOUR DATABSE. Here is the way to backup and restore database
Steps to replace string –
1. Enter in to phpMyAdmin with your database credentials and select your website Database
2. Select SQL tab
3. And past the below SQL query
UPDATE `jos_content` set introtext=replace(`introtext`, 'old string to replace', 'new string') WHERE 1
1. Replace jos_ with the table prefix you used, if it is jos_ at your end then no change required
2. Replace old string to replace with the actual string you want to replace
3. Replace new string with the string you want to replace with
4. Now just click on GO button to execute the query
Explaining the above command variables
a. jos_content – is the table name on which you wants to execute update command
b. introtext – is the field inside the table that stores Joomla article data
c. old string to replace – old string that needs to be replaced(you can replace with yours)
d. new string – new string to replace (you can replace with yours)
Here you are done, go ahead and check your old string has been replaced with new one.






