WordPress 4.6 Will Detect Broken Links in the Editor

WordPress 4.6 is set to introduce a broken link checker in the editor, a handy new feature which lead developer Andrew Ozz dubbed “spellcheck for URLs.” Ella Van Dorpe, who is co-maintainer with Ozz on WordPress’ editor component, opened a ticket three months ago to begin work on detecting broken URLs. She proposed that bad links could be shown with a message in the toolbar in order to prevent accidental user mistakes when entering links.

After working through various approaches for detecting broken links, contributors on the feature settled on having WordPress test if the link is well formed. Users can instantly see when a link they have added is broken, as it will appear linked in red in the link tooltip.

broken-link-checker

The broken link checker is also accessibility friendly and uses wp.a11y.speak() to announce bad URLs with an audible warning message.

“This is the logical next step for enhancing how we handle links (and URLs in general) in the editor,” Ozz said.

Broken links are essentially dead ends, and the new link checker helps prevent WordPress content authors from accidentally contributing to link rot, a growing problem on the web. The feature is available in the visual editor and there are two weeks remaining to test. WordPress 4.6 RC 1 was released last week and the official release is expected the week of August 16.

21

21 responses to “WordPress 4.6 Will Detect Broken Links in the Editor”

  1. Hi, I’ve tested this in 4.6. RC but it seems to be working only for really incorrect links.

    If I link to a non-existing url on a WordPress installation I get a 404 error page. However this 404 error page is not marked as an error in the new broken link checker. It looks like the 404 error page is not noticed by this new feature.

    Am I the only one who notices this? Or is this how it is supposed to work?

    • If so, then i really hope they will just remove this feature from the release version as it does require computing capacity all the time while writing a post (maybe regular regex checks with AJAX?), still does not have any sense at all. I mean WP should not be developed for such dummies who can not even copy&paste a formally valid URL.

      • Peter, this is untrue: copy&paste mistakes happen to everyone. I regularly come across blog posts by seasoned web professionals, which contain links that are malformatted in the http://http://example.com way (where the URL that was pasted without first deleting the http://) or in the example.com/www.example.org way (where the http:// part was is missing).

        I have always been hoping for the WordPress editor to “spell-check” such common mistakes.

        • Well… seasoned web professionals know it for sure, that they really should not post anything to the publicity without proofing content&layout, images, links, etc. There is no code that could do that instead of humans and that is why there are drafts and even post preview in WP.
          Regex is quite computing intensive and making it regularly while writing a post is definately not a wise idea. Features like that will turn post writing into a very frustrating and slow experience.

          To prevent that i just thought of a new feature, we could call it shiny posts ;-). What if the post writer would hit any key and WP would automatically generate a flawless and complete post out of that? This idea is so bright and sophisticated, would make WP the only choice for everyone, am sure dummies and pros will love it alike, so when will this be implemented into core? :-)

        • copy&paste mistakes happen to everyone.

          Exactly. This is the main reason to add that check.

          In its first iteration it was using the server as proxy to follow each URL. However this didn’t work that well. At the end only a regex “well-formed” check remained. This still catches the more common copy/paste errors but not things like 404s. See the trac ticket (linked in the post) for more info.

        • @Andrew Well just tried v4.6 on localhost. The link checker accepts anything that contains at least one . (dot).
          I mean really crazy things like .totally.insane.link. or even non-existing protocols and double dots like hxty://ftp//:.insanity.. get accepted as well.
          It is even more disappointing as i imagined it to be. So much code for actually nothing :-(

          IMO it is bloating core because only about 0.0001% of link rot is caused by http://http:// at the beginning of the link.

          I mean the initial idea was good but the actual implementation has no use at all. What if the initial idea would be implemented as an option to check if already posted links are still alive or not and just forget totally insufficient regex checks in the editor?

  2. Not needed and not wanted. When you include a link in a post or page, you just verified the link is good, otherwise you wouldn’t be linking to it.

    Broken link detectors are useful for checking links long after the post or page was published. They let you update your post or page with a working link or no link at all.

    • Agree. A broken link checker would be absolutely needed somewhere under Settings or Tools menu. Maybe it could generate a list of questionable links (and related posts) and one could directly try to reach the link with a button beside the link. If the link is reachable one could confirm it as a working link. If it is not reachable then it could be confirmed as broken. Question is what should happen to broken links in already published posts? Should be just the link removed or even the text as well, or maybe just a strikethrough effect should be applied to the text of the broken link?

    • That was exactly my thought while reading this. If I just copied a link and pasted it my post, why would I need a checker at that moment? Seems ridiculous.

      A checker I could run periodically, or that would run in the background on some regular schedule, and report broken links on old posts back to me would be very useful.

  3. Ehmm, got confused… will it check if the link is really broken or will it just check if an entered url is well-formed or not?
    The later would be much ado for nothing …however the first option would be a great feature!

  4. It seems the idea morphed over time as the ticket progressed. What started as a suggestion to check for a broken link in the editor, turned into only a well-formed URL check. So the feature is now misnamed, which is adding confusion to understanding what the feature does.

    Also, while preventing “link rot” is a worthy goal, I don’t see how this feature makes a contribution to that. A link must be good before “rotting”, and this feature is merely checking a link in the editor.

  5. This feels like something which should be in a plugin if people want it. Not personally convinced of it’s need to be in the core.

    If it was a feature which went back over past articles to alert you of link rot, I could see the value in that. Still not sure that should be core either though.

  6. Hi, is it somehow possible to change the default of the new “insert/edit link” dialog box (under the “link options” cogwheel), to make all links open in new windows? i.e. the “open link in new tab” checked? it would save some editors a lot of clicks (for posts that have a lot of links that have to be opened so).

    See screenshot below.
    http://prntscr.com/ca54w7

    Or is the only way to add one of the older plugins which do this? like
    https://wordpress.org/plugins/open-external-links-in-a-new-window/
    will those even work with the upgraded editor in wordpress 4.6?

    Thanks..

  7. It looks though this new WordPress goody may be interfering with the Broken Link Checker plugin.

    This plugin has been among my “must have” plugins for years now. However, since WordPress was updated to v4.6, my websites are now experiencing major issues.

    Two of my websites posts and pages were showing EVERY external link as being broken for several days before this checker even reported them as broken … even though NONE are broken. I had to Deactivate the plugin on those sites.

    The plugin is designed to test all links on a regular bases and if ANY broken links are found, an email is sent to the website’s administrator … which has made it easy for me to keep a closer watch on ALL websites that I tend.

    The Broken Link Checker would be a perfect plugin to have merge into the WordPress platform. That way, we’d all have a constant watch on our links, not just simply at the time of posting or publishing.

  8. Hi, my site is in intranet, so my link structure is like “server/website/page”. If I link to internal pages the link is marked as broken. Only if I add “www.”-links this feature works well. But now all my links are “broken” even if they aren’t. Is it possible to adjust this for internal links? Otherwise I need to deactive it in WP code if I’ll find the related script :-(

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.