WordPress.org

Ready to get started?Download WordPress

Forums

Link Library
Report broken links function (1 post)

  1. CarolWP
    Member
    Posted 1 year ago #

    I've been looking for a way to enable visitors to report broken links on my site. While I already use Broken Link Checker, 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. 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

    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:
      [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>

      In the "Mail" section, put your e-mail address as both the "To" and "From" address. Put the following in the "Subject" field:

      Broken link: [linkurl]

      In the "Message Body" field, put the following:

      [linkurl]
      
      Message:
      [your-message]

      Save the form.

    3. Copy the code at the top of the page you are then on.
    4. 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.
    5. Using FTP, go to your plugins folder, and then to the link-library folder inside it. Download the file called link-library.php.
    6. Open the link-library.php file in the text editor of your choice. Look for the link that says:
      $output .= stripslashes($afteritem) . "\n";

      Immediately before it, insert the following lines, substituting the URL of your site for http://www.example.com:

      $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>";

      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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by CarolWP
  • This topic is not a support question
  • WordPress version: 3.5.1