To disable cropping, insert this below code in disable-automatic-image-crop.php file in your mu-plugins folder:
<?php
/*
Plugin Name: Disable Automatic Image Crop
Author: WordPress Community
Description: https://gist.github.com/czenzel/0f5888cbbfa4a857e56361dd3bc19b39
*/
add_action( 'init', 'czc_disable_extra_image_sizes' );
add_filter( 'image_resize_dimensions', 'czc_disable_crop', 10, 6 );
function czc_disable_crop( $enable, $orig_w, $orig_h, $dest_w, $dest_h, $crop )
{
// Instantly disable this filter after the first run
// remove_filter( current_filter(), __FUNCTION__ );
// return image_resize_dimensions( $orig_w, $orig_h, $dest_w, $dest_h, false );
return false;
}
function czc_disable_extra_image_sizes() {
foreach ( get_intermediate_image_sizes() as $size ) {
remove_image_size( $size );
}
}
?>
It’s completely disabled automatic image cropping for all sizes.
Related Posts:
- Best way to include wp-config.php
- What security concerns should I have when setting FS_METHOD to “direct” in wp-config?
- What could a hacker do with my wp-config.php
- How to Delete All regenerated thumbnails but keep the original ones?
- Make thumbnails in woocommerce replace the main image instead of opening fancybox
- Using Advanced Custom Fields with WordPress and Lightbox
- WP Config for FTP credentials
- Bad Request (Invalid Hostname) on working server, database problem
- Some plugins adding full server path after url (with custom wp-content folder)
- How to link to YouTube videos with thumbnails?
- register_theme_directory somehow “fails” when folder is outside of WP-Folder
- htaccess and wordpress config files are regularly over written
- plugings request url is the old url
- Add Image to the RSS plugin reader from another RSS [closed]
- Can you limit the memory usage of a particular plugin?
- Single Must Use Plugins Directory for local development
- Enable Full SSL for WordPress
- How to change constants in WordPress wp-config.php programmatically?
- Enabling WP_USE_EXT_MYSQL to support old plugin
- DOMAIN_CURRENT_SITE constant being regularly overridden [closed]
- Regenerate thumnails does not create any files
- Add padding while generating thumbnail
- Redirect to another page using contact form 7? [closed]
- Use wp-config.php constants in all files of plugin
- Can WordPress Drop-ins be given their own directory?
- Editing wp-config.php
- What is the purpose of WP_CONTENT_URL?
- WordPress failing to update plugins
- How to request admin-ajax.php correctly when wordpress URL and site URL are different?
- Woocommerce: Set thumbnail detail (clipping area)
- Thumbnail image doesn’t show up in Shortcode output
- How to get database connection details without longing to cpanel in WordPress?
- Display Multiple Photos as Featured Image when mouse moves on to it post
- WordPress wp get_temp_dir return non exiting folder, thus failing plugin & themes update
- Cannot display wordpress thumbnail
- Does WordPress have a way of changing the ‘Natural’ size of uploaded images?
- How to install ffmpeg extension for php 5.6.25 for wp video posts plugin?
- resizes images on the fly
- Multiple thumbnails and one gallery
- Thumbnails have stopped generating correctly
- How to add multiple versions of the same featured image for SEO reasons?
- Thumbnails and Lightbox
- How can I server scaled images?
- Using wp config to connect to a DB from a plugin
- No plugin updates after moving wp-config.php above root map
- Trying to use Advanced Custom Fields with custom image sizes
- What is the best way to change share image for social networks? [closed]
- WordPress plugin archive
- Namespaces in WordPress – How do I initiate the main class?
- Plugin readme.txt and assets internationalization
- post expire after x days
- MailChimp integration that allows users to select from multiple lists [closed]
- How to handle autoloading with composer by keeping the WordPress naming conventions?
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- filemtime() warning when enqueuing style within plugin
- Minimum PHP Required for WordPress
- Post query – show posts from specified day and month and whole years
- tag breaks shortcode output (other solutions don’t work)
- How to overwrite core/libraries/vendor template with child theme
- Plugin integrate in forum to show user profiles [closed]
- WP_Query and NULL meta keys
- Error when using plugin QuickCache with plugin Mobile Smart ? [closed]
- URL rewrite of independent plugin?
- WordPress : Explain Plugins & Theme string value in database
- Why Does the WordPress Twitter Tools Plugin give a 500 Internal Server Error?
- Opening a link automatically on page load?
- can we modify wordpress plugin version value to avoid update warning?
- Plugins for logo in wp themes? [closed]
- Is there a plugin for automatically adding a word or symbol after a trigger word? I.e. Like a search and replace but more like search and add? [closed]
- How to display the featured post on the category page?
- How to Show Author image and url in WordPress plugin directory? [closed]
- Renaming Custom Taxonomy Values
- Load plugin script in specific page
- jQuery code didn’t run on my plugin
- Call ajax on the frontend
- How do I profit from a Plugin?
- Can I customize an Elementor template after inserting it? [closed]
- Create automatic latest version link
- Some error in mysql script ? Can’t working to create table
- Gutenberg: Prevent links from being clickable in the block. Error: “Cannot destructure property ‘frameElement’ of ‘r’ as it is null.”
- list of custom post by custom field in frontend
- How to add a prefix to a WordPress post preview url?
- i can not access the post in custom template of my wordpress plugin
- How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
- Exclude Tag Links from and Text
- How to remove row action “Edit with Visual Composer” in the post list table?
- Defined user role to access plugin’s pages
- Better code/text editing for posts and pages?
- Saving an array to get_options
- Plugin that resets database and deletes all content, plugins
- Custom Fields on User Dashboard?
- Make a Custom template for a specific category in wordpress
- In WordPress, after installing “Pie Register” plugin, admin permission is GONE! [closed]
- The plugin has been used here? [closed]
- Self-hosted Plugins & Themes store with auto-updates? [closed]
- Woocommerce Export Orders with Order Item Meta
- Allow direct access to files/folders within WordPress to replace wp-admin
- How to set meta-data for my plugin
- WordPress isn’t sending welcome email with the password reset
- Unable to login – critical error