Support » Plugins and Hacks » Hacks » [Resolved] How to disable wordpress Media Library Completely?

[Resolved] How to disable wordpress Media Library Completely?

  • Hello,

    I have a question please help. I have some experience with wordpress.

    I want to disable WordPress Media Library completely. What I am trying to say is I don’t want wordpress to create ids for every image I upoad.

    Becuase as you know every media item can be accessed by using it’s id I don’t want that. I only want wordpress to upload images store them in uploads folder and make links to put inside the post.


    [caption id="attachment_170" align="aligncenter" width="300"]<a href="http://localhost/wp/wp-content/uploads/2012/01/screenshot.png"><img src="http://localhost/wp/wp-content/uploads/2012/01/screenshot.png" alt="123" width="300" height="225" class="size-full wp-image-170" /></a> 123[/caption]

    In this code I don’t want wordpress to create [id=”attachment_170″] or add it the the posts media library. Is there any way, any plugin to do that?

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi


    Forum Moderator

    Can I ask why?

    I use single.php on my theme to show advertisements. So when the media item is accessed by it’s url the ads show up too right next to the images which violates the google terms.

    Right now I use another website with wordpress to upload the images and them copy the upload code back to my site.

    Is there any way or plugin which just uploads the images and not attach them with posts and make uniques ids for them?



    Forum Moderator

    If you upload images via the Media Library itself, there will be no Post or Page attachments. But images will still have unique ids. That part is pretty central to the way in which WordPress works.

    Okay thanks for the help. Please answer this question.

    If I want to redirect the attachment urls to the post url they are attached to, can I do that?

    Like this is the POST URL


    and this is the Attachment URL


    can I redirect the Attachment URL to the POST URL automatically



    Forum Moderator

    Not without getting into some fairly advanced coding.

    All right I guess I will just keep using the other website to add imgages. Thanks for the information.

    Hello please asnwer this one last question, can I delete stuff from Media Library without actually deleting the images from uploads folder. like running an sql query or something like that?

    Never mind I made it work. This code in functions.php redirects attachment pages back to the posts.

    	function attachment_redirection() {
    	global $post;
    	if ( is_attachment() ) {
    	add_filter( 'wp_head', 'attachment_redirection' );

    To only remove an object from attachment pages but show it on posts I used this

    <?php if ( is_single() && !is_attachment() ) : ?>
    	<div class=banner>Banner</div>
    <?php endif; ?>
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] How to disable wordpress Media Library Completely?’ is closed to new replies.