Solved

Prevent my Non-Techie Wordpress Users from Hotlinking

Posted on 2013-01-24
4
396 Views
Last Modified: 2013-01-25
I have a customer website with around 50 authors creating content for the site every day.  Some of these authors are less technical and keep hotlinking to images on other websites.  Does anyone know if there is a plugin for Wordpress that disables the insert image from another url feature?  

To be clear, I don't have others linking to my images.  I have non-technical users who are creating <img src="xxxx"> tags that link xxxx to some other websites image
0
Comment
Question by:jer2eydevil88
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:andy_adams
ID: 38819765
I don't know of a plugin that does this, but if you're comfortable adding your own filters, you can do something like the following (assuming you're on WP 3.5):

function my_filter_media_view_strings( $strings ) {
    unset( $strings['insertFromUrlTitle'] );

    return $strings;
}

add_filter( 'media_view_strings', 'my_filter_media_view_strings' );

Open in new window


This will remove the option from the media overlay. Let me know if you hit any issues!
0
 
LVL 3

Author Comment

by:jer2eydevil88
ID: 38819834
What file would I edit in WP 3.5 to put this modified code?
0
 
LVL 2

Accepted Solution

by:
andy_adams earned 500 total points
ID: 38819854
The easiest way would be to add your own plugin, with a single file. The contents of the file would look like this:

<?php
/*
Plugin Name: Prevent Image Hotlinks
Plugin URI: #
Description:
Author: jer2eydevil88
Version: 0.1
Author URI: #
*/

function my_filter_media_view_strings( $strings ) {
    unset( $strings['insertFromUrlTitle'] );

    return $strings;
}

add_filter( 'media_view_strings', 'my_filter_media_view_strings' );

Open in new window


You could upload this file to your wp-content/plugins/ directory, or ZIP it up and install it using the built-in installer. Let me know if that does it!
0
 
LVL 3

Author Closing Comment

by:jer2eydevil88
ID: 38819915
Needed the closing ?> for the PHP tag.  I went ahead and put it into a folder and zipped it so others can use this.  

https://syntress.com/?attachment_id=29379011
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you use a default hosting installation of wordpress with the intention of it being your actual site?  Maybe you’ve installed it as a Blog to your current site and recently converted it to be the main site and do away with the old .htm pages.  An…
How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now