if you want to check by programmatically then you can use following function for check, if SEO is exist or not. this will work in all version.
function check_seo($keyword = ''){
if(version_compare(VERSION, '3.0.0.0', '<')){ // below 3.0.0.0 version
$SQL = "SELECT * FROM " . DB_PREFIX . "url_alias WHERE `keyword` LIKE '" . $this->db->escape($keyword)."'";
}else{
$SQL = "SELECT * FROM " . DB_PREFIX . "seo_url WHERE `keyword` LIKE '" . $this->db->escape($keyword)."'";
}
$found = $this->db->query($SQL." LIMIT 1")->num_rows;
if($found){
// SEO already exists
}else{
// You can use this $keyword for SEO
}
}
like if you want to check only for mac category SEO then check below Query and image,
Query :
SELECT * FROM `oc_url_alias` WHERE `query` LIKE 'category_id=%' AND `keyword` LIKE 'mac'
4
Answers
Checking for duplicate SEO
Controller
Model
Depends on what version of OpenCart do you use. In OpenCart 3 when you try to save SEO URL that already exist – you will receive a message
Although there is a place, where yo can search across all OpenCart SEO URLs. You will find it in Design – SEO URL
if you want to check by programmatically then you can use following function for check, if SEO is exist or not. this will work in all version.
like if you want to check only for
mac
category SEO then check below Query and image,Query :
You can solve this issue with simple steps.
-> Go to your opencart database and find "oc_seo_url" table open it.
-> search that records which are have keyword field null/empty
-> delete that records
You can see in the picture bellow.