AshleyAR Posted May 23 Share Posted May 23 I need help fixing these 302 redirects on my site. It took me forever to figure out that the drop down URL's automatically redirect to the first menu item, but I don't know how to fix it. Drop Down URL's. Google Ads has continuously flagged this website as "Compromised" and "Circumventing Systems". I took over this project from a team member who left, so I have been trying to work through all her coding, running malware scans and using SEM Rush. This is my first site launch so there is a learning curve. I know 302 redirects really shouldn't impact ads being run, but at this point I want the site optimized to the best of my ability. So when I appeal this time it will go through. I haven't been able to get this client's ad campaign live since "The Golf Pages" were activated in late March. Link to comment
Sifat_SEOSpace Posted May 25 Share Posted May 25 Hi @AshleyAR, I'm happy to help you. Yes, this dropdown menu automatically creates a 302 redirect. It's a Squarespace functionality and won't affect your website's search engine performance. If you'd like to fix this with custom coding (though I'm not 100% sure), you can try the following: Add the below code into your Settings » Advanced » Code Injection » Footer area. This code will turn any folder, with a url that ends in -folder/, into a clickable folder. The url preceding the -folder/ will be the clickthrough url. For example, in the below example the folder will clickthrough to the page /pagename Code: <script> (function () { let folders; function rebuildAnchor(folder) { let parent = folder.closest('.header-nav-item--folder'), href = folder.href.includes('.com') ? folder.href.split('.com')[1].replace("-folder/", "") : folder.href.replace("-folder/", ""), anchorClone = folder.cloneNode(true); anchorClone.classList.add('clickable-folder'); anchorClone.setAttribute('href', href); anchorClone.style.cssText = ` opacity: 1; transform: unset; `; parent.insertAdjacentElement('afterbegin', anchorClone); if (href == window.location.pathname) { console.log() anchorClone.closest('.header-nav-item--folder').classList.add('header-nav-item--active') } } function addToMobile(folder) { let href = folder.getAttribute("href"), hrefAdjusted = href.includes('.com') ? href.split('.com')[1].replace("-folder/", "") : href.replace("-folder/", ""), text = folder.innerText, newText = `All ${text}`, mobileFolder = document.querySelector(`[data-folder="${href}"]`), backButton = mobileFolder.querySelector(".header-menu-nav-folder-content > *:first-of-type"), allButton = `<div class="container header-menu-nav-item header-menu-nav-item--external"> <a href="${hrefAdjusted}">${newText}</a> <div>`; backButton.insertAdjacentHTML('afterend', allButton) } /* Select All Folder Links & */ function setFolderLinks() { folders = document.querySelectorAll('.header-display-desktop .header-nav-folder-title[href*="-folder/"]'); for (let folder of folders) { window.addEventListener('load', function() { addToMobile(folder); rebuildAnchor(folder); folder.remove(); }); } } setFolderLinks(); })(); </script> If you've any further question, feel free to ask. Best wishes, Sadul Sifat SEOSpace Team SEOSpace - The SEO Plugin for Squarespace. Get a Free Squarespace SEO Audit: https://www.seospace.co/squarespace-seo-audit-score Link to comment
LucaF Posted June 16 Share Posted June 16 Hi guys, I have similar issue with my site nav drop down menu creating loads of 302s...Is this not bad for SEO and SERP Ranking? would prefer to change this to 301s but not really sure how. Have you managed to resolve this? my web is https://www.moonstruckdigital.com.au/ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment