Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
noindex hatena blog
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function() {
<!-- NOINDEX -->
if (document.getElementsByTagName("body")[0].classList.contains("category-noindex")){
console.log('add noindex'); // noindex が追加されているかの確認用。不要なら消してください。
var head = document.getElementsByTagName("head")[0];
var meta = document.createElement("meta");
meta.setAttribute("name","robots");
meta.setAttribute("content","noindex");
head.appendChild(meta);
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.