Stop Header Ad link opening in new window [SOLVED!]


I would like to stop the Header Ad link opening in a new tab and make it open in the same window. Is that possible?

If not, is it possible to disable the Header Ad link completely?

Thanks :slight_smile:


I’m not sure what exactly is your issue.

Can you please provide a link to your website?

Kind Regards, Roman.

1 Like

Hello there,

Please try doing these steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    ;(function($) {

      if( $('.header-ad').length ) {
         $('.header-ad a').removeAttr('target');


4 . Update


1 Like

Hi thanks for replying. My website is still under construction and is at:

I know it is not used as intended but because it suited my layout and design I have used the Header Ad to display the main title logo for the site.

However if you mouse over it on the page you will see it is a clickable link which opens a new page. Ideally I would like it to not be a link at all. Alternatively I would like to set it to link back to the home page - which I can do but it will open in a new window if anyone clicks on it.

Is that a little clearer? Thanks again for your help :slight_smile:

Thank you I will try this and report back :slight_smile:

UPDATE: I went to install the plug in but got the message: “Warning: This plugin has not been tested with your current version of WordPress”. I am running WordPress 4.9.4 and TC Custom Javascript is only compatible up to 4.8.5.


I’ve just checked Kharis’ solution and it worked with WordPress 4.9.4 on my local GreatMag install.

Kind Regards, Roman.

1 Like

Thank you @kharisblank @roman it worked perfectly! :slight_smile::slight_smile::slight_smile:

You are welcome! :slight_smile:

Kind Regards, Roman.