Is it possible to disable the cropping step when adding a site icon via the Theme Customizer in WordPress 5+ (occurred to me in 5.5)?
For me cropping is unnecessary because I always upload a square image in the directions of the recommendations.
That's why this step is not helping me at all, instead is actually causing the following problems:
cropped
prefix.Thus all the settings I did for the attachment of the un-cropped image are lost and the filename of the site icon will always include this cropped
prefix.
Is there anyway to fix this without patching the source of this problem?
Is it possible to disable the cropping step when adding a site icon via the Theme Customizer in WordPress 5+ (occurred to me in 5.5)?
For me cropping is unnecessary because I always upload a square image in the directions of the recommendations.
That's why this step is not helping me at all, instead is actually causing the following problems:
cropped
prefix.Thus all the settings I did for the attachment of the un-cropped image are lost and the filename of the site icon will always include this cropped
prefix.
Is there anyway to fix this without patching the source of this problem?
To force the site icon to be a specific attachment you can use the wp-admin/options.php
page and search for the site_icon
label then change the value of the field to the attachment ID you would like it to be.
Of course this also can be done via SQL, with a query somewhat similar to:
update wp_options set option_value=123 where option_name='site_icon';
Note that this only works once you initialized the site_icon
option.
Unfortunately, there's still no fix to this issue. WordPress will still crop the image even though your favicon is 512px x 512px.
To solve this issue, I installed Elementor and updated my site icon via the Site Settings. It doesn't crop the image and you won't have to deal with an additional file in your media library with the cropped
prefix.
WordPress is crap, but I found that if you select the icon through the general settings page instead of the customizer and click "Save changes", it doesn't create a cropped version. The size requirement alone is ridiculous, since a favicon normally has no more than 32x32 pixels.
To skip cropping and use SVG as a site icon you can use WP-CLI:
wp option update site_icon 123
In this example 123 is the ID of the file.
For the issue you're facing, the cropping step in WordPress is tied to how the theme customizer processes the uploaded site icon. Unfortunately, there isn't an option to disable this cropping step directly through the Theme Customizer interface in WordPress 5+. but there are some workarounds that might help:
1- Use the General Settings Page: Instead of uploading the site icon through the Theme Customizer, try uploading it via the General Settings page (Settings > General). This method should prevent WordPress from cropping the image, as it uses the image as-is without modification.
2- Check Image Dimensions: Make sure the image you are uploading is square and meets the recommended dimensions (such as 512x512 pixels). This will help reduce the chances of cropping.
3- Use Plugins: You can install plugins like Simple Image Sizes or Regenerate Thumbnails. These can help you control how WordPress handles image sizes, including disabling the cropping process for the site icon sometimes.
4- Modify functions.php: If you're good at coding, you could add a custom filter to the functions.php file of your theme to disable the cropping step completely.
Regarding the comment made by the user named Bachsau in this topic, I would like to clarify that WordPress is not "crap." In fact, it is one of the most robust and flexible and powerful website builders and content management systems out there for developing websites. WordPress has a steep learning curve, but with the right knowledge and expertise, it can be a powerful tool. It's about finding a professional who understands how to navigate its intricacies to achieve the best results.