EDITS.WS

Tag: media library

  • How to Free Disk Space and Reduce Inode Usage in WordPress

    Are you running out of disk space and inodes for your WordPress website?

    If you run out of disk space and inodes, then you might see different errors. For example, you won’t be able to upload images, send or receive emails, update blog posts, and more. Your users will also have a hard time accessing your website.

    In this article, we will show you how to reduce disk space and inodes on WordPress.

    How to reduce disk space and inodes on WordPress

    Why Free Up Disk Space and Reduce Inode Usage?

    When you purchase WordPress hosting for your website, each service will provide a certain disk space and inode limit.

    Inode is where the metadata for files is stored, like the file size and its physical location. Inode usage equals the number of files and folders on your hosting account.

    Initially, you don’t have to worry about these limits, as you’ll be just starting out. However, as your WordPress site grows, more files and folders will take up disk space and utilize inodes. Once you reach your WordPress hosting company’s allotted limit, you’ll notice several issues on your site.

    For instance, you won’t be able to send or receive emails from your website, have difficulty uploading images and other content to the media library, and update content on pages and posts.

    If the disk space is full, then your visitors might also face problems while accessing your website. Besides that, migrating your site to another host might also not work if you don’t have enough disk space.

    Reducing disk space and inodes will help resolve these issues. Plus, you will see better website performance and a smooth user experience.

    With that, let’s see how you can check disk space usage on your WordPress site.

    How to Check Disk Space in WordPress

    There are multiple ways you can check the disk space in WordPress. The easiest way is by accessing the cPanel of your hosting service.

    All web hosting providers offer statistics on disk usage, file usage, number of email accounts, and more.

    For example, if you’re using Bluehost, then you can simply log in to your account. After that, head to the ‘Advanced’ tab from the menu on your left. The column on the right side will show statistics about disk and file usage.

    View disk usage in Bluehost

    That said, let’s look at ways to increase disk space and free up inodes in WordPress. You can click the links below to jump ahead to your preferred section.

    1. Use Image Optimization Tools to Reduce Their Size

    A simple way to save disk space is by optimizing your images. You can use different tools to reduce the image size without lowering its quality. Besides that, you can change the file format (PNG, JPEG, GIF) and dimensions to reduce the image size by 80%.

    It not only helps save inode usage but also makes your website load faster. You also get faster website backups and improved SEO rankings.

    Image optimization tools use compression technology to lower the file size of the picture. You can use photo editing software like Adobe Photoshop, Affinity, or web tools such as TinyPNG or JPEGmini.

    Optimized vs Unoptimized Images in WordPress

    There are also different WordPress plugins that automatically compress images when you upload them.

    For more details, please see our guide on how to optimize images for web performance without losing quality.

    2. Prevent WordPress from Generating Image Sizes

    Did you know WordPress creates multiple copies of an image when you upload it to your website?

    WordPress automatically generates different image sizes, which include thumbnail, medium, and large sizes in addition to the original picture.

    WordPress Automatically Creates Copies of Your Images in Different Sizes

    These image sizes will take up disk space and inodes on your website. Besides, the backup size of your site will also become large due to different versions of a single image.

    A simple way to prevent WordPress from generating multiple image sizes is using the Stop Generating Unnecessary Thumbnails plugin. It is a free plugin that lets you disable image sizes.

    You can learn more by following our guide on how to prevent WordPress from generating image sizes.

    3. Don’t Upload Videos to WordPress

    Another way you can reduce disk space, and inodes is by ensuring that you don’t upload videos to WordPress.

    Directly uploading videos to your site means using more bandwidth and disk space. If you have high-quality videos, then it will utilize even more resources. You will also need different plugins to manage and display videos, which means using more disk space.

    A better alternative is to upload videos to sites like YouTube or Vimeo and then embed them on your site. This way, you’ll free up disk space and bandwidth. Your videos will also get more exposure since YouTube is the second most popular search engine and the most visited site.

    You can follow our guide on how to easily embed videos in WordPress blog posts for more details.

    4. Clean Your WordPress Media Library

    Cleaning your WordPress media library is a great way of incresting disk space and reducing inodes in WordPress.

    If you have media files that are not in use, have multiple copies of the same image, or have pictures in the incorrect size, then you can remove them to free up space.

    Usually, you can head to Media » Library from the WordPress dashboard and select an image you want to remove. Once the image attachment details open, simply click the ‘Delete permanently’ option.

    Delete images from library

    However, the manual process is time-consuming, and it can be hard to find media files that are not in use.

    A more efficient way is to use WordPress plugins that help clean the WordPress media library. For example, Media Cleaner is a free plugin that scans your site for unused media files in the library and posts/pages. You can then decide which files to keep and which to remove.

    For more details, please see our guide on how to clean up your WordPress media library.

    5. Remove Inactive WordPress Plugins and Themes

    Do you have WordPress plugins and themes that are inactive and currently not in use?

    Having inactive WordPress themes and plugins means they are using inodes and taking up disk space. You should remove these plugins and themes to increase disk space and reduce inode usage.

    To remove plugins, simply head to Plugins » Installed Plugins from your WordPress admin panel. Next, click the ‘Delete’ button for any plugin that is not being used.

    Delete inactive plugins

    Similarly, you can also delete inactive WordPress themes.

    First, you will need to go to Appearance » Themes from your WordPress dashboard.

    Delete inactive themes

    From here, click on the theme you want to remove.

    A new popup window will open with the details of your WordPress theme. Go ahead and click the ‘Delete’ button at the bottom right corner.

    Delete a theme

    6. Delete Draft Blog Posts and Pages

    Just like inactive themes and plugins, removing draft blog posts and pages can also free up disk space and reduce inodes in WordPress.

    They would take up unnecessary space, and you can improve website performance by deleting them.

    Simply go to Posts » All Posts from your WordPress admin area. Next, click the ‘Trash’ button under any draft blog post.

    Trash draft blog post

    You can do the same for draft pages on your website.

    WordPress also allows you to bulk delete posts and pages. For more details, please see our guide on how to bulk delete WordPress posts.

    7. Empty Your Mailbox and Delete Unused Email Accounts

    If you’re using email accounts on your hosting service, then they also take up space and utilize inodes on your site.

    To reduce inode usage and save disk space, you can check your emails and delete any unwanted emails. These can be spam emails or old emails that are not required anymore.

    Similarly, if you have multiple email accounts set up on your WordPress hosting service, then you can delete accounts for inactive users. You can access your mailbox and different email accounts using the cPanel of your hosting provider.

    8. Clear Cache and Old Backup Files in WordPress

    Cache plugins are super useful in speeding up your WordPress website and providing a better user experience.

    However, these plugins can generate a high amount of cache files if left unchecked. As a result, they will utilize inodes on WordPress. That’s why it is a best practice to clear the WordPress cache at regular intervals and reduce inode usage.

    Different WordPress hosting services and caching plugins come with a built-in option to clear the cache.

    For example, Bluehost allows clearing your cache from the WordPress admin area. Simply select the ‘Caching’ option in the toolbar at the top and click the ‘Purge All’ option to remove the cache.

    Clear Bluehost cache

    Similarly, if you’re using WordPress security and backup plugins, then clearing old security reports and backups will also significantly improve your inode usage and disk space issues.

    For instance, if you’re using Duplicator for backups, then you can view existing backups and delete the old ones from your WordPress dashboard.

    Simply go to the Duplicator Pro » Packages page and select your old backup. After that, click the Bulk Action dropdown menu and select Delete.

    Delete existing backups in WordPress

    You can get started with the free version of Duplicator, and we highly recommend checking out the Pro features, too.

    We hope this article helped you learn how to free up disk space and reduce inode usage on WordPress. You may also want to see our guide on WordPress security and tips to speed up WordPress performance.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Free Disk Space and Reduce Inode Usage in WordPress first appeared on WPBeginner.

  • How to Download Your Entire WordPress Media Library (3 Ways)

    Do you want to download all the images and media files from your WordPress website?

    By downloading your media library, you can easily store a backup of your media files on your computer or, if you have created another WordPress site, then you can also transfer these images from one site to another.

    In this article, we’ll show you how to easily download your entire WordPress media library, step by step.

    How to download your entire WordPress media library

    Why Would You Want to Download the Media Library?

    The WordPress media library stores all the media files that you have uploaded to your site. If you want to create a backup of these media files, then you can easily do that by downloading a copy of the media library and storing it on your computer.

    You can always use a fully automated WordPress backup solution to back up your entire WordPress site (including plugins, themes, posts, and the media library).

    However, most backup plugins do not offer an easy way to just download and upload your media library.

    You could also use your WordPress hosting account file manager or FTP to download the media library, but these methods are a bit complicated and confusing for beginners.

    With that being said, we’ll show you some easy ways to easily download your entire media library in WordPress.

    Method 1. Download Media Library Using The Export Media Library Plugin

    For this method, we’ll be using a plugin to download the media files.

    First, you need to install and activate the Export Media Library plugin. For more details, see our guide on how to install a WordPress plugin.

    Upon activation, go to the Media » Export page from your admin area.

    Once you’re on the ‘Export Media Library’ page, simply choose the ‘Single folder with all files’ option from the dropdown menu beside the ‘Folder Structure’ option.

    Download the media library using the Export Media Library plugin

    Now all your media will be downloaded into one folder. They will be downloaded as the original file types, such as JPG, PNG, or SVG.

    If you want your media to be placed into separate folders based on the time of upload, then choose the ‘Nested Folder’ option from the dropdown menu.

    After that, simply click the ‘Download Zip’ button, and your entire media library will be downloaded into a zip file on your computer.

    Method 2. Download the Entire WordPress Backup Including Media Files

    If you want to create a backup for your entire WordPress website including the media library, then this method is for you.

    We’ll be using the Duplicator plugin which is the best WordPress backup plugin on the market and enables you to create a complete backup of your WordPress website.

    First, you’ll need to install and activate the Duplicator plugin. For more details, see our guide on how to install a WordPress plugin.

    Upon activation, you need to visit the Duplicator » Packages page from the admin sidebar and click on the ‘Create New’ button.

    Create a new backup by clicking the Create New button

    Next, you need to choose a name for your WordPress backup.

    It can be anything that will help you identify the backup once it’s downloaded on your computer.

    After that, click on the ‘Next’ button to continue.

    Choose a backup name

    In the next step, your website will be scanned for potential errors.

    Once the scan is complete, simply click on the ‘build’ button to create your package.

    Note: If an error is highlighted by Duplicator during the scan, you would need to solve that error before rescanning and building your package.

    Scan complete

    Once the package is built, you need to click on the ‘Download Both Files’ button.

    Now, your installer and archive files will be downloaded simultaneously.

    Click the Download both files button

    Your WordPress website backup including media files will now be downloaded and stored on your computer.

    If you want to restore a WordPress backup, you may also want to see our guide on how to restore WordPress from a backup.

    Method 3. Download Media Library Using WordPress Settings

    In this method, we’ll show you how to download your entire media library from your WordPress backend and import it to another WordPress website.

    Note: This method allows you to download the media library without using any plugins. However, we do not recommend this method because it exports your media as an XML file.

    This method can come in handy if you want to import your WordPress media library to one of your other websites.

    For that, head over to the Tools » Export page from the WordPress admin dashboard.

    Now that you’re on the ‘Export’ page, simply check the box beside the ‘Media’ option.

    If you don’t want to download your entire library, then you can also select a date range for a specific time frame. With this feature, only the images uploaded during your chosen time frame will be downloaded.

    Finally, click on the ‘Download Export File’ button.

    Choose media on the export page

    Now, your WordPress media library will be saved on your computer as an XML file.

    Next, you need to install and activate the WordPress Importer plugin. For more instructions, please see our guide on how to install a WordPress plugin.

    This plugin will allow you to import your XML file to another WordPress website.

    First, you need to visit the Tools » Import page from the admin sidebar.

    Then you can simply click on the ‘Run Importer’ link below the ‘WordPress’ option.

    Click on the run importer link

    This will take you to the ‘Import WordPress’ page where you need to click on the ‘Choose File’ button.

    Now, you can upload your media library XML file from the computer.

    Import media

    Once you’re done, don’t forget to click on the ‘Upload file and import’ button to upload the media library.

    We hope this article helped you download your WordPress media library. You may also want to see our tutorial on how to speed up your WordPress website, and our comparison of the best Instagram plugins for WordPress.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Download Your Entire WordPress Media Library (3 Ways) first appeared on WPBeginner.

  • How to Easily Organize Media Uploads by Users in WordPress

    Do you want to organize media uploads by user in WordPress?

    If you run a multi-author website, then you may want to restrict each author’s media library access to only their own uploads. This can prevent an author from accidentally deleting another user’s images, and help keep subscriber-only content private.

    In this article, we’ll show you how to organize media uploads by users in WordPress.

    How to organize media uploads by users in WordPress

    Why Restrict Author Access to Media Uploads?

    If you have a multi-author WordPress blog, then people might be uploading lots of different images. This can make it difficult for an author to find the right image, or they might delete or edit another person’s media file by accident.

    This can cause all sorts of problems including poor productivity, lots of extra work for site admins and editors, and a complicated editorial workflow.

    This unlimited access can also be a privacy concern. For example, if you’re working on a new product or idea, then other authors might see confidential images in the media library before you make a public announcement.

    If you have a WordPress membership site, then contributors and subscribers may be able to access premium media files they shouldn’t have access to. For example, if you sell online courses then a contributor might use their media library access to download premium PDFs and other course materials, without buying a subscription.

    That being said, let’s take a look at how to restrict who can see media uploads inside your WordPress admin area. Simply use the quick links below to jump straight to the method you want to use.

    Method 1. Organizing Media Uploads by Users With a Plugin (Quick and Easy)

    The easiest way to restrict access to media uploads is by using the Frontier Restrict Access plugin.

    This free plugin checks whether a user has the edit_others_posts permission, which allows them to edit another user’s posts.

    By default, this ability is granted to everyone who has the site admin or editor role. If you want to change this, then you can add or remove capabilities to user roles in WordPress.

    If the user doesn’t have this permission, then once this plugin is activated, they won’t be able to access another user’s files in the WordPress media library. This allows you to organize media uploads by users, without restricting access for admins and editors.

    This plugin works out of the box and there are no settings for you to configure, so you can simply install and activate the Frontier Restrict Access plugin. For more details, see our guide on how to install a WordPress plugin.

    Method 2. Organizing Media Uploads Using Code (Advanced)

    Another option is to restrict access to files in the media library using code. This method requires you to add a code snippet to your WordPress blog or website, so it isn’t the most beginner-friendly method. However, you won’t need to install a separate plugin just to organize your media uploads.

    Often, you’ll find guides with instructions to add custom code to your WordPress theme. However, this isn’t recommended as mistakes and typos in your code can cause common WordPress errors, or even break your site completely.

    That’s why we recommend WPCode.

    WPCode is the best code snippets plugin used by over 1 million WordPress websites. It makes it easy to add custom code in WordPress without having to edit the functions.php file.

    For this method, we’ll be adding code that checks whether the user has the edit_others_posts permission. If they don’t have this permission, then the code snippet below will stop them from accessing other people’s files in the WordPress media library.

    The first thing you need to do is install and activate the free WPCode plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, head over to Code Snippets » Add Snippet.

    How to add custom PHP snippets to your site using WPCode

    Here, simply hover your mouse over ‘Add Your Custom Code.’

    When it appears, click on ‘Use snippet.’

    Adding a custom code snippet to WordPress

    To start, type in a title for the custom code snippet. This can be anything that helps you identify the snippet in the WordPress dashboard.

    After that, open the ‘Code Type’ dropdown and select ‘PHP Snippet.’

    Restricting access to the media library using WPCode

    In the ‘Code Preview’ area, paste the following code snippet:

    add_filter( 'ajax_query_attachments_args', 'user_show_attachments' );
     
    function user_show_attachments( $query ) {
        $user_id = get_current_user_id();
        if ( $user_id && !current_user_can('activate_plugins') && !current_user_can('edit_others_posts
    ') ) {
            $query['author'] = $user_id;
        }
        return $query;
    } 
    

    Next, just scroll to the ‘Insertion’ section. WPCode can add your code to different locations, such as after every post, frontend only, or admin only.

    We want to use the custom PHP code across our entire WordPress website, so click on ‘Auto Insert’ if it isn’t already selected. Then, open the ‘Location’ dropdown menu and choose ‘Run Everywhere.’

    Running custom PHP code across your website using WPCode

    After that, you’re ready to scroll to the top of the screen and click on the ‘Inactive’ toggle, so it changes to ‘Active.’

    Finally, click on ‘Save Snippet’ to make the PHP snippet live.

    How to restrict access to media files using code

    Now, users will only have access to the files they upload to the WordPress media library.

    We hope this article helped you better organize media uploads by users on your WordPress site. Next, you can check out our ultimate WordPress security guide or see our expert pick of the best contact form plugins for WordPress.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Easily Organize Media Uploads by Users in WordPress first appeared on WPBeginner.

  • A Step Beyond WebP with Converter for Media

    If you want to get your images as small as possible and make your site load blazingly fast, you need to adopt AVIF. You can start right now with a WordPress plugin called Converter for Media.

    The post “<strong>A Step Beyond WebP with Converter for Media</strong>” first appeared on WP Mayor.