Title: Report broken links function
Last modified: August 20, 2016

---

# Report broken links function

 *  [CarolWP](https://wordpress.org/support/users/carolwp/)
 * (@carolwp)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/report-broken-links-function/)
 * I’ve been looking for a way to enable visitors to report broken links on my site.
   While I already use [Broken Link Checker](http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/),
   that helps only if a link has disappeared entirely. If the URL still exists but
   no longer contains the expected content, it won’t help. For example, suppose 
   that what was once a helpful article is now a porn site. I’d like my visitors
   to be able to tell me so.
 * I have been searching for something that works. Unfortunately, the only “Report
   broken links” plugins I could find would report that a particular page on my 
   site had a broken link, but would not report which link was broken. With a large
   links library, I didn’t want to have to go through every link on a page to figure
   out which one had the problem. I also wanted something that could not be triggered
   accidentally or by spam bots. And I wanted something that would put in the bad
   link to be reported automatically, rather than having to have the visitor retype
   the bad link and possibly typo it.
 * I’ve now developed a function that works for this purpose, as described below.
   You can see it in action in any of the links pages linked from [this link](http://benefitsattorney.com/library).
   However, I’m a WordPress newbie, so I’d love to see any refinements that anyone
   can come up with for this. In particular, my solution involves modifying the 
   Links Library plugin–and thus will be overwritten any time Links Library gets
   updated. While it will be easy enough to fix each time, I’d love to find a solution
   that doesn’t require that.
 * **Ingredients**
    - [Link Library plug-in](http://yannickcorner.nayanna.biz/wordpress-plugins/link-library/)
    - [Contact Form 7 plug-in](http://contactform7.com/)
    - [Really Simple CAPTCHA plugin](http://ideasilo.wordpress.com/2009/03/14/really-simple-captcha/)
    - [Contact Form 7: Get Parameter from URL into Form Plugin](http://elementdesignllc.com/2011/11/contact-form-7-get-parameter-from-url-into-form-plugin/)
 * **Instructions**
    1.  Install all plugins listed above.
    2.  Create a new contact form in Contact Form 7 by clicking on “Contact” on the
        left side of your administrative menu, then “Add New” on the page that comes
        up. Call the form something like “Report broken link form.” In “Form,” use 
        the following code:
    3.      ```
            [getparam linkurl]
            Thank you for helping us keep our database updated.  Please fill in your comments, if any, and complete the Captcha to report this broken link:
        
            <p>URL to be reported:<br />
               [showparam linkurl]</p>
        
            <p>Comments<br />
                [textarea your-message] </p>
        
            <p>Type the letters and numbers into the box below. <br />
            [captchac captcha-513 size:l]<br />
            [captchar captcha-513]</p>
        
            <p>[submit "Send"]</p>
            ```
        
    4.  In the “Mail” section, put your e-mail address as both the “To” and “From” 
        address. Put the following in the “Subject” field:
    5.  `Broken link: [linkurl]`
    6.  In the “Message Body” field, put the following:
    7.      ```
            [linkurl]
        
            Message:
            [your-message]
            ```
        
    8.  Save the form.
    9.  Copy the code at the top of the page you are then on.
    10. Create a new WordPress page. The title would be something like, “Report Broken
        link.” In the body, paste the code you just copied in the previous step. For
        purposes of the rest of this discussion, I’ll assume that the slug of that 
        page is report-broken-link.
    11. Using FTP, go to your plugins folder, and then to the link-library folder inside
        it. Download the file called link-library.php.
    12. Open the link-library.php file in the text editor of your choice. Look for 
        the link that says:
         `$output .= stripslashes($afteritem) . "\n";`
    13. Immediately before it, insert the following lines, substituting the URL of 
        your site for [http://www.example.com](http://www.example.com):
    14.     ```
            $output .= "<br><small><a href=http://www.example.com/report-broken-link?linkurl=";
            $output .= $linkitem['link_url'];
            $output .= " target=\"_blank\">Report broken link</a></small>";
            ```
        
    15. Save the link-library.php file, and upload it back to your link-library folder.
 * Now in your library pages, each of your links will have a small “Report broken
   link” following it. Clicking on that will bring up a form that says:
 * > Thank you for helping us keep our database updated. Please fill in your comments,
   > if any, and complete the Captcha to report this broken link:
   > URL to be reported:
   >  [The URL they are trying to report will automatically 
   > appear here.]
   > Comments
   >  [input field for comments]
   > Type the letters and numbers into the box below.
   >  [Captcha image] [input field
   > for Captcha]
   > [Send button]
 * Notice that the only thing the visitor has to fill in is the Captcha. The URL
   is already filled in, and the comments are optional.
 * When someone reports a broken link, you will get an e-mail that with the subject,“
   Broken link:” followed by the URL of the broken link. The body will again have
   the URL of the broken link, then “Message:”, then any comments that the user 
   submitted.
 * ********
    Anyone got any comments or suggestions for improvements on all this?
 * [http://wordpress.org/extend/plugins/link-library/](http://wordpress.org/extend/plugins/link-library/)

The topic ‘Report broken links function’ is closed to new replies.

 * ![](https://ps.w.org/link-library/assets/icon-256x256.jpg?rev=971117)
 * [Link Library](https://wordpress.org/plugins/link-library/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/link-library/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/link-library/)
 * [Active Topics](https://wordpress.org/support/plugin/link-library/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/link-library/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/link-library/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [CarolWP](https://wordpress.org/support/users/carolwp/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/report-broken-links-function/)
 * Status: not a support question