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>
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024