Stop WP from cropping images
WordPress allows you to control how images are resized and whether they are cropped or shrunk proportionally. Here’s how you can achieve this:
- Media Settings:
- Go to your WordPress dashboard.
- Navigate to Settings > Media.
- Here, you’ll see the default image sizes: Thumbnail, Medium, Large, and sometimes others depending on your theme or plugins.
- Uncheck the box that says “Crop thumbnail to exact dimensions (normally thumbnails are proportional)” to ensure images are resized proportionally.
- Theme Functions:
- If your theme is defining image sizes and cropping them, you might need to adjust the theme’s
functions.php
file. - Look for
add_image_size
functions. This function can have a cropping parameter. - For example,
add_image_size('custom-size', 300, 300, true);
will crop the image. If you changetrue
tofalse
, it will resize the image proportionally without cropping. - After making changes, you might need to regenerate thumbnails using a plugin like “Regenerate Thumbnails” to apply the new settings to existing images.
- If your theme is defining image sizes and cropping them, you might need to adjust the theme’s
- Plugins:
- There are plugins available that give you more control over image sizes and cropping. One popular option is “Simple Image Sizes”.
- With such plugins, you can create custom image sizes and choose whether to crop them or resize them proportionally.
- Manual Resizing:
- Before uploading, you can manually resize images using graphic software like Photoshop, GIMP, or online tools. This way, you have full control over the final appearance of the image.
- CSS Approach:
- If you’re comfortable with CSS, you can use it to control the display of images on the frontend. For instance, using
object-fit: contain;
can ensure images fit within their containers without being cropped.
- If you’re comfortable with CSS, you can use it to control the display of images on the frontend. For instance, using
Remember, if you make changes to how images are sized or cropped in WordPress, you might need to regenerate your thumbnails for the changes to apply to existing images. The “Regenerate Thumbnails” plugin can help with this.