WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
The images get uploaded by the WordPress theme functionality "custom-background" this won't work. – user2019515 Oct 7 '13 at 11:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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