Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
hey guys,
Im going to try to keep this short. Ive been with SHOPIFY for about 10 years, over that timespan, we've used apps, deleted them etc. These apps created new urls, we've tried redirecting as many as possible in the past, we've removed them temporarily from google search, we've disallowed them, however I'm trying to find a permanent solution to fix 10 years worth of mistakes, I was just looking through my source code and found that the links, urls or apps still have a hold on my site. here is the code that I want to fix to ensure that all links redirect to the main urls and to notify google that these links no longer exist….period.
atom has been there forever, won't go away, a/s/, shopsherrif, en-us, were apps and links we created but deleted. the other ones I have no idea what they are. here is my site and here is the code I want to find and fix, for the life of me I can't locate it in my theme:
<script>
var currentParameters = window.location.search;
if(currentParameters != '') {
var urlPath = '/';
var url = urlPath + currentParameters;
var checkQueryParameters = 'shopsheriff,yvu1,zhanbu88,a/s/,wpm@,.html,web-pixels-manager,&pr_seq=uniform,en-us,.atom'
if(checkQueryParameters != '') {
var checkQueryParameters = checkQueryParameters.split(',');
}
var processNoIndexNoFollow = false;
if(document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) {
var processNoIndexNoFollow = true;
} else {
var processNoIndexNoFollow = true;
}
if(processNoIndexNoFollow == true) {
var metaRobotsFound = false;
for (i = 0; i < checkQueryParameters.length; i++) {
var checkParameters = url.includes(checkQueryParameters[i]);
if(checkParameters == true) {
metaRobotsFound = true;
break;
}
}
if(metaRobotsFound == true) {
var metaRobots = document.getElementsByName("robots");
for(var i=metaRobots.length-1;i>=0;i--)
{
metaRobots[i].parentNode.removeChild(metaRobots[i]);
}
var meta = document.createElement('meta');
meta.name = "robots";
meta.content = "noindex,nofollow";
document.getElementsByTagName('head')[0].appendChild(meta);
}
}
}
</script>
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025