Is it possible to restrict the size of the custom background image? I recently released a theme and I notice that people are uploading very large images to use as background image which of course causes the page to load very slow.

Can you specify the dimensions of the background image somehow so that after the upload the image will be resized?

1 Answer 1


There are two parts to the answer:

  1. You can set the size of images using add_image_size. This is done in your functions.php.

    add_image_size( 'background-image', 900, 500 ); //900 px wide 500px high - no crop
  2. Once this is set you will need to regenerate your thumbnails. There are number of great plug-ins that can help you with that task. After you add the new image size all future imports will be sized correctly. Now to use it you can call the Wordpress thumbnail:


Depending on how you saved the image, you may need to use another method to recall the image size but there are a number of ways to do this.

  • The images get uploaded by the WordPress theme functionality "custom-background" this won't work. Oct 7, 2013 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.