Solved

Prevent my Non-Techie Wordpress Users from Hotlinking

Posted on 2013-01-24
4
394 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

743 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

16 Experts available now in Live!

Get 1:1 Help Now