Solved

Prevent my Non-Techie Wordpress Users from Hotlinking

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

791 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