remove "Attachment Post URL" button from media upload (5 posts)

  1. cowley_mis
    Posted 3 years ago #

    I've set up a website for county departments to post their own information to the county website. Things are pretty good, except people repeatedly post links to PDFs and the like using the "Attachment Post URL" button instead of straight to the file URL.

    I've found a way to remove this button in the media.php file under wp-admin\includes, but I really don't want to modify a core wordpress file.

    Is there a way to disable or hide this button without changing core wordpress files? If so, what file do I need to modify, and what do I need to change?


  2. metalmusicman
    Posted 2 years ago #

    I would also like to know how to remove the "Attachment Post URL" button-- there's no reason that anyone on my site should click anything but "none" or "File" for the attachment link, yet for some reason a lot of people click "Attachment" and screw up our highslide/lightbox script :\

  3. Lyndon Roeller
    Posted 2 years ago #

    me too! anyone?

  4. leoloso
    Posted 2 years ago #

    I have "fixed" this issue by simply hiding that button using a style.

    I define a file admin.css which is loaded only when I'm in the Admin panel

    In file:

    if (is_admin()) {

    * Register my own admin.css for adding new styles
    * Adds the function 'add_my_stylesheet' to the
    * wp_enqueue_scripts action.
    function add_admin_stylesheet() {

    echo '<link rel="stylesheet" href="' . get_bloginfo('stylesheet_directory') . '/css/admin.css" type="text/css" />';
    add_action( 'admin_print_styles', 'add_admin_stylesheet' );


    In file:

    # Hide the "Attachment Post URL" from the Media Gallery
    .urlpost {

    visibility: hidden;

    Hope this helps!

  5. leoloso
    Posted 2 years ago #

    Sorry, replace the comment

    # Hide the "Attachment Post URL" from the Media Gallery


    /* Hide the "Attachment Post URL" from the Media Gallery */

    Or if not it comments also the css below

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.