How To Save Space on Your WordPress Blog Server


Sponsored Links






Right now, many blogger uses WordPress for their Publishing platform, I will give some tips how to save space on your WordPress blog server. We will added little bit php code in our functions.php theme files. This code is Automatically uses resized images instead the originals size.

Write code to Automatically uses resized images insteaad the originals below

function replace_uploaded_image($image_data) {
    // if there is no large image : return
    if (!isset($image_data['sizes']['large'])) return $image_data;

    // paths to the uploaded image and the large image
    $upload_dir = wp_upload_dir();
    $uploaded_image_location = $upload_dir['basedir'] . '/' .$image_data['file'];
    $large_image_location = $upload_dir['path'] . '/'.$image_data['sizes']['large']['file'];

    // delete the uploaded image
    unlink($uploaded_image_location);

    // rename the large image
    rename($large_image_location,$uploaded_image_location);

    // update image metadata and return them
    $image_data['width'] = $image_data['sizes']['large']['width'];
    $image_data['height'] = $image_data['sizes']['large']['height'];
    unset($image_data['sizes']['large']);

    return $image_data;
}
add_filter('wp_generate_attachment_metadata','replace_uploaded_image');

This code is doing automatically, so you didn’t needed any command anymore. Thanks for Serge Rauber for tricks about Save Space in WordPress blog server.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

How To Linking to all image sizes in WordPress

This is latest Justin Tadlock tutorial, on January 2011. Using the functions that Justin created wonderful method to display all image size link, it’s flickr like method. We can put it on example attachment.php or image.php There are two steps … Read More

How To Set default Content in WordPress editor

There are some reason we need to add automatically default content in WordPress Post. The main reason for us is, re write some content again and again, It's really pain. Justin Tadlock has been create some function and this function … Read More

Create a Side Blog with WordPress 3.0

If you need to know How To Create a Side Blog with WordPress 3.0, I will show you how to do it. This tutorial is original created by CatsWhoCode, Thanks for share this wonderful tricks. Like on my other Tricks … Read More

We are Testing New Server

For some reason, our old WP Tricks got many problem that I can describe, so we began to search something better. And here we go, now we are happy using VPS server for WordPress. We use LiteSpeed web server and … Read More

Allow Upload of More File Types

Why I love WordPress? It's because many developer and designer support out there. Some of them give us nice tutorial and tricks. On this post I will share to all of you about How To allow upload of more file … Read More

How To Save Space on Your WordPress Blog Server / WordPress Tricks

Right now, many blogger uses WordPress for their Publishing platform, I will give some tips how to save space on your WordPress blog server. We will added little bit read more

Source: http://wptricks.net/how-to-save-space-on-your-wordpress-blog-server/

Turn Off Picture Thumbnails in WordPress & Save Web Server Space

When you publish a blog post that has a screenshot or a picture, WordPress will automatically create two image thumbnails in your uploads folder on the web server. read more

Source: http://www.labnol.org/internet/blogging/turn-off-wordpress-picture-thumbnails/4007/

Save Lots Of Server Storage In Wordpress - gHacks Technology News

This time it is how to save lots of server storage space in WordPress. WordPress, as you may know, comes Ghacks is a technology news blog that was founded in 2005 by read more

Source: http://www.ghacks.net/2010/11/08/save-lots-of-server-storage-in-wordpress/

WordPress › Blog Tool, Publishing Platform, and CMS

you can use to create a beautiful website or blog. We like to say that WordPress is Read the Documentation and become a WordPress expert yourself, impress your friends. read more

Source: http://wordpress.org/

WordPress Backups « WordPress Codex

Your WordPress database contains every post, every comment and every link you have on your blog. up your WordPress database for various server file to save space read more

Source: http://codex.wordpress.org/WordPress_Backups


One Response to How To Save Space on Your WordPress Blog Server

  1. Tech support says:

    Where so I put the code so it works

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>