Oh, yes! This is one of the worst and most despicable bugs I’ve encountered in 7 years of working with WordPress!
I just finished publishing a post, but I clicked on one of its links and noticed that it opened in the same tab, which immediately triggered my spider-sense because I know I always make a post’s links to open in a new tab (with few exceptions).
So, I clicked on another link, then another one, and then another one! All of them opened in the same tab!
Then I checked my previous post, then the previous one, and then the previous one! Same issue!
I freaked out big time because I knew what awaits me – hours of troubleshooting and then hours of fixing the issue!
After performing some troubleshooting, I found out the culprit – the Grammarly browser extension!
I should have known that adding an extension that can modify my content (apparently, not only when I want to) will be bad news in WordPress.
So, here’s the deal.
How is the Grammarly browser extension stopping WordPress links for opening in a new tab
Actually, it’s more serious than it sounds because it doesn’t just stop links from opening in new tabs, and once you disable it everything goes back to normal.
No, it actually removes the target="_blank"
attribute from your <a>
tags!
BOOM, bye!
Here’s what I’m talking about:
As you can see, in the Text editor, there’s clearly a target="_blank"
attribute, which allows the link to open in a new tab.
But, if I switch to the Visual editor and click on the G icon – which brings up a pop-up editor – then the target="_blank"
attribute is removed from the link and from any other links that might have been there!
Apparently, it only does this if you click the G icon while you are on the Visual editor, not the Text one.
I also checked on my testing website that uses another theme and a few plugins, which I disabled. Didn’t try another browser, though, just on Firefox.
So, if you’ve done this for a long time, all of your posts’ links will probably open in the same tab now!
What’s there to do
Manual editing the WordPress
I went through each post, clicked on a link, and if it opened in a new tab, it meant that the post was ok. Then I checked another post, and so on until I found the ones that have messed up links, and I began editing them.
But, I am lucky! I haven’t used the Grammarly browser extension for very long, so I was able to find all the messed up posts and fix them in several hours.
I even brought down my website for a brief moment because I was checking and editing so many posts, so fast, that I was generating a lot of executions, which lead to a nice 502 server error.
Alternatives to manually editing the WordPress links
If you have used the Grammarly browser extension for a lot of time, and you have way too many posts to edit manually, then you should just install this plugin.
This wasn’t an option for me since I also want internal links to open in a new tab, not just external links. It might not be an option for you either.
When a user is in the middle of a post, I don’t want him/her to click on a link and load another post on top of the current one. It’s annoying as hell.
Your second alternative could be finding and adding a custom code that opens all the posts’ links in a new tab. I couldn’t find any, though.
If a web developer happens to read this, perhaps he/she can give us a hand.
Of course, this issue can happen to pages as well, but:
- You usually have way fewer pages than posts;
- Pages usually don’t contain so many links;
- Most of you use page builders to create pages, and this issue probably won’t happen on page builders.
Bonus Grammarly bug on WordPress
Your toolbar won’t be sticky anymore when using the Text editor, like I do, which is very annoying.
That will be gone as you’ll start to scroll down when your post gets bigger.
Contacting Grammarly
UPDATE: Grammarly responded (fast, I might add), saying that they are aware of the issue and are trying to find a fix, but can’t provide an estimated time frame for that.
I contacted Grammarly and told them about this awful problem. Hopefully, they’ll fix it.
I’ll update the post and let you know their response.
I don’t know if I’ll keep using it, though, even if they do.
It’s too risky, and I just dodged a serious bullet today, since my situation could have been a lot worse. I’m in paranoid mode now.
That’s a wrap
Hope your links are still opening in new tabs even if you use Grammarly :D .
Don’t forget to share the post to help out others!
If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.
You can also hit the follow button on Twitter and subscribe to the YouTube channel.
If you want to start your own WordPress blog, or need a website for your business, ThemeSkills’ WordPress installation service is at your disposal! On-going WordPress support and maintenance are on the menu as well!
You can also purchase a ready-made WordPress website with hosting and support included!
It’s April 2019 and Grammarly is still doing this. Bizarre
Thanks for the update! I haven’t used it on live sites since then, so I haven’t paid attention to it anymore. I copy posts to my testing site and check them there with Grammarly.