Liquid, JavaScript, themes, sales channels
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>
User | RANK |
---|---|
37 | |
26 | |
14 | |
13 | |
9 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023