It appears Google has somehow managed to crawl and index the /user/password page (according to Google Search Console) - is it possible to set it to "noindex" (without using Node noindex)?

Comments

I`m use JS:

var path = window.location.pathname.substring(1);
var noindex = ['user','search'];
noindex.forEach(el => {
    if (path.indexOf(el) > -1) {
        setNoindex();
        return;
    } 
});
function setNoindex() {
    var meta = document.createElement('meta');
    meta.name = 'robots';
    meta.setAttribute('content', 'noindex');
    document.getElementsByTagName('head')[0].appendChild(meta);
}

Thanks for the suggestion, but I don't know where to put that.

Since I'm using a sub-theme of Snazzy, it would go in the sub-theme as a new file?

Neither Snazzy or snazzytoys currently have this file - snazzytoys is set as the default theme in Backdrop.