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]
- WP_TEMP_DIR unlink(dirname(__FILE__).’ issue
- Amazon.com intergration with WordPress?
- How to best create a jQuery Slider to display a native wordpress gallery?
- Free paypal cart solution [closed]
- Best/Correct way to add an option to a category
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- “W3 Total Cache” with “What Would Seth Godin Do” (and widgets?!)? [closed]
- Add filter on html tags,attributes on specific function in wordpress
- XML Sitemap Generator can’t notify google and bing
- cforms plugin function “my_cforms_logic” (for writing custom logic), is running 5 times
- Adding rel=”nofollow” to external links in posts?
- Best Sitemap Plugin for 1M+ pages [closed]
- Collecting email addresses via a “beta” sign up form
- Plugin that provides the [edit] shortcode?
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- How to limit image size for the entire website ? But without editing the post (css/plugin?!)
- Problem installing plugin: unexpected T_STRING, expecting T_FUNCTION
- How do I get the Twitter Tools widget to display my tweets?
- Why are my WordPress store items showing up in duplicates?
- When I try to de-activate any plugin it gives error “Warning: call_user_func_array() [function.call-user-func-array]”
- Plugins for logo in wp themes? [closed]
- How to remove js ui library added by default by wordpress
- 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 set category correctly for a custom post created by a remote API call?
- Can I do in-page changes binding events/triggers to actions in WordPress?
- Can inactive WordPress plugins still load scripts?
- What is the best way to cache pages on WordPress
- How to see which sites use my installed plugins (wordpress multisite)
- Product count in archive page Title in WooCommerce [closed]
- Use current class method inside add_submenu_page()
- how remove font to increase site speed load
- Plugin main file is constantly been fired on every website visit
- Why is Google Search Console getting X-Robots-Tag noindex?
- Website show Google Ads when we have no Google Ads linked to our website
- How to set “split_on_numerics” to false in ElasticSearch mapping using ElasticPress? (for proper SKU search in WooCommerce) [closed]
- Sticky option for custom post types without using custom fields or plugins
- My plugins are ending up above the header?
- Let users sell video in my website [closed]
- Change letters for day name
- Where should custom post types be registered in a plugin?
- Keeping and updating ACF and ACF Pro at the same time
- Pass user role to javascript code inside body
- A plugin that downloads other plugins
- Php page with filters for custom fields
- How to be escape Variables and options when echo?
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- Basic question about accessing scripts in my plugin
- Gutenberg Blocks – Cannot retrieve block saved attributes in edit post
- plugins not working in custom theme
- How to use template_include hook with form submission?
- Adding Plugin Assets to Header
- Release the plugin in the WordPress repository where redux is used