We wanted to know how large files are on our WordPress system, but this functionality is not within WordPress by default.
The following code will need to go into your Functions.php file. To locate the functions.php file, navigate to Appearance -> Theme Editor -> functions.php
Add the following snippet to the file. Take note of the comments in the code.
You will also see from the image that we utilise a child theme with our editor Avada. We highly recommend you use a child theme. The following development blog from WordPress will show you why you would want to use a child theme. Link Here. In short, if your theme builder or theme gets updated by the original developer, all your added code to the functions.php file will be overwritten, where a child theme will not because a child theme extends the functionality of your theme.
Copy to Clipboard
The code above has SgS, short for Scenegraph Studios. You can name those variable names anything you wish.
If you are unsure with anything though, you can just copy and paste and all should be good, but we take no responsibility for security or issues.
By david|2021-09-01T12:31:05+00:00March 14th, 2021|Dev Blog, Development|Comments Off on Show file size in WordPress Media library