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

Note:- Please don’t forget to update the below points in above command –

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.

Related posts:

Author:

is co-founder and author of tips4developer. By profession he is a WordPress and Joomla developer.


Subscribe to email feed

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin

Joomla – Allowing

Recently I got an requirement to add multiple email ID’s ...

WordPress - Controll

Page Lists Plus is one of the most use full ...

IE compatible mode

I noticed most of the web developers and designers hate ...

Adding PayPal Donate

Adding PayPal Donate Button in WordPress Post and Page are ...

Multi Browsers CSS H

Here I am sharing few of the very useful multi ...

Joomla – Allowing

Recently I got an requirement to add multiple email ID’s ...

Virtuemart – Setti

In my last project I got a requirement from my ...

3 Best Security Ext

Joomla is one of the fastest growing and best CMS ...

Joomla Conditional S

With the help of Joomla conditional statements you will able ...

Virtuemart - Special

Here I am sharing the virtuemart code snippet to display ...