Tag: media-library

  • Half Baked Idea: Limiting WordPress Image Upload Sizes

    Half Baked Idea: Limiting WordPress Image Upload Sizes

    Limit image upload size in WordPress media library by using the `wp_handle_upload_prefilter` filter. Implement a custom function to check and restrict the size of uploaded images. Utilize PHP code to set a maximum size limit and display an error message if the file exceeds it. Add this functionality to your WordPress site.

  • Validating WordPress attachments with WP-CLI

    Validating WordPress attachments with WP-CLI

    I recently worked on migrating a site to a different server and for one reason or another, some of the images did not come over properly. While I could have just re-downloaded and re-imported all of the media, it would have taken quite a while since the media library was well over 100Gb. Instead, I…