Zen Cart Logo
Forums / General Questions / Mass delete selected meta tag in database

Mass delete selected meta tag in database

Locked

Views: 1,728

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
6 Aug 2010, 11:39 AM
#1
beep avatar

beep

New Zenner

Join Date:
Nov 2008
Location:
London
Posts:
94
Plugin Contributions:
0

Mass delete selected meta tag in database

Hello,
Does anyone know the SQL command for mass deleting a specific meta tag in products and categories? Kind of like find and replace but actually find and remove.

This is all I found while searching the forums. Code for deleting categories meta tags:

DELETE from metatags_categories_description WHERE categories_id = CATEGORY_ID_HERE;

Code for replacing specific meta tags in products:

UPDATE products_description SET products_description = REPLACE(products_description, "2x3'", "2x3 Foot");

so I'm guessing some combination of the two.

6 Aug 2010, 1:31 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Mass delete selected meta tag in database

Personally, I'd really recommend learning to use phpMyAdmin to do this kind of thing. It is pretty easy and it lets you look at the entry in the database first and then delete it.

phpMyAdmin is usually accessible from the control panel of most hosting.

(phpMyAdmin is just the most common interface for this - there are lots of others)

11 Aug 2010, 12:26 PM
#3
beep avatar

beep

New Zenner

Join Date:
Nov 2008
Location:
London
Posts:
94
Plugin Contributions:
0

Re: Mass delete selected meta tag in database

niccol:

Personally, I'd really recommend learning to use phpMyAdmin to do this kind of thing. It is pretty easy and it lets you look at the entry in the database first and then delete it.

phpMyAdmin is usually accessible from the control panel of most hosting.

(phpMyAdmin is just the most common interface for this - there are lots of others)

I know how to access phpmyadmin already but only how edit entries in the database individually. Does anyone know if there is a command to find and remove all occurrences of one word or phrase en mass?
:unsure:

11 Aug 2010, 1:16 PM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Mass delete selected meta tag in database

It will be something like this:

UPDATE meta_tags_categories_description SET field_name = REPLACE(field_name, "string_to_find", "string_to_replace");

Obviously back up first :smile:

If you just want to delete something then the string_to_replace is just "".

field_name is the column name in the table. For instance it might be metatags_keywords