Solved

Prevent my Non-Techie Wordpress Users from Hotlinking

Posted on 2013-01-24
4
395 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to Import and export files in WordPress. 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 : Click on Too…

919 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

19 Experts available now in Live!

Get 1:1 Help Now