Skip to main contentSkip to footer

How to remove en-gb from the SEO URL of Opencart 4?

Rupak Nepali
Share:
How to remove en-gb from the SEO URL of Opencart 4?

In Opencart 4, when we activate the SEO URL it contains the language as well and for the English language, it shows en-gb by default, which we don’t like so we looked to remove it and the easiest way to remove en-gb is by following code. The following code will not work if you have multiple languages, it works only for English because we are replacing en-gb from the URL, we will find a way soon to remove all the languages and post the solution here.

SEO best practices for Opencart 4

Open file /system/library/url.php and find the following code:

if (!$js) {
	return str_replace('&', '&', $url);
} else {
	return $url;
}

And, replace with the following code:

if (!$js) {
	return str_replace('en-gb/', '', str_replace('&', '&', $url));
} else {
	return str_replace('en-gb/', '',$url);
}

Speed up the Opencart 

This will remove the en-gb from the Opencart 4 URL. Please let us know if you have any questions or suggestions, please subscribe to our YouTube Channel for Opencart video tutorials and you can see more in the Opencart tutorial category. You can also find us on Twitter and Facebook. Enjoy!

Comments

Join the conversation and share your thoughts

Leave a Comment

Your comment will be reviewed before publishing.

Be the first to comment on this post!

Innovation

Let's Make Something Amazing Together

We always provide our best creative ideas at the highest level. Tell us about your project and we will make it work.

InnovateBringing innovative solutions to complex problems
AutomateStreamlining processes through automation
DominateLeading the market with exceptional results
Build Smarter and Launch FasterEfficient development for rapid deployment