Skip to content

Remove tag using javascript

Is there a way to remove title tag using javascript?

I tried to do this

var parent = document.head;
var child = document.title;

but it failed because title tag is not a node (console said). I need to force a WordPress plugin to overwrite the default title tag with a custom one.

Any ideas?


The title property just contains a string representation of the title. It doesn’t represent the element itself.

You can use any of the usual methods to get the element itself.

// etc