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>
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024