WordPress GuideBuild → Insert a Background Image

How to insert a background image in WordPress (only one page)

inserting a background image on one page

Want to give a single page on your site a unique look without changing your entire theme? Whether it’s a landing page, a contact page, or something seasonal, WordPress gives you a few easy ways to set a different background image for just one page.

You don’t need to be a developer, and you don’t need to install a new theme. Let’s walk through the most reliable options—from simple drag-and-drop plugins to a few cut-and-paste code tricks.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

Why use a different background image on one page?

Before we jump into the how-to, let’s talk about why you might want this kind of customization. Using a different background image on just one page can help you:

Here’s how to make it happen …

Method 1: Use a page builder plugin (like Elementor)

If you want full design control without writing any code, a page builder is the easiest solution.

Here’s how to do it with Elementor:

You can also add overlays, control how the image behaves on scroll, or apply effects—all without touching your theme files.

Why use this method?

Method 2: Add a background image with custom CSS (using the page ID)

If you don’t want to use a page builder, you can apply a background image with a few lines of CSS. You’ll just need the page’s ID and the image URL.

Step 1: Find the page ID

Step 2: Add your custom CSS

body.page-id-123 {
  background-image: url('https://yourdomain.com/wp-content/uploads/your-image.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

Optional tweaks:

This method works on any theme and won’t affect other pages.

Method 3: Use the body_class filter (advanced users)

If you prefer to use a custom class name instead of relying on a page ID, you can use the body_class filter to add a specific class to your page.

Step 1: Add a class to the page body in functions.php

In your child theme or custom theme, add this to functions.php:

function add_page_class_to_body( $classes ) {
  if ( is_page( 'Contact' ) ) { // Replace with your page title or slug
 $classes[] = 'contact-background';
  }
  return $classes;
}
add_filter( 'body_class', 'add_page_class_to_body' );

Step 2: Add your CSS

Now go to Appearance > Customize > Additional CSS and use:

body.contact-background {
  background-image: url('https://yourdomain.com/wp-content/uploads/contact-bg.jpg');
  background-size: cover;
  }

This method is flexible and makes your CSS easier to read, but it does require editing theme files.

Method 4: Use the WordPress Full Site Editor (block themes only)

If your theme supports Full Site Editing (like Twenty Twenty-Four), you can create a custom template directly in the editor.

How to use the Full Site Editor:

This method doesn’t use CSS. It works entirely within the block editor, which is perfect if you’re building your site with blocks and want a no-code solution.

Method 5: Create a custom page template (for advanced customization)

Steps to set it up:

This method is best if you’re already building a custom theme or working in a child theme.

This method gives you full control over the layout and styling, but it’s best for developers or users comfortable working with PHP and WordPress theme files.

Troubleshooting background image issues

If your background image isn’t showing up or behaving as expected, here are some things to check.

Background image not showing?

Image only covers part of the page?

Slow load times?

Additional resources

How to build a WordPress site →

A complete beginner’s guide that covers 9 key steps to a successful launch

Website builders vs. WordPress →

With website builders and WordPress at your disposal, you don’t need to expend your energy or savings to build a website that suits your brand.

How to use WordPress Gutenberg blocks →

A complete beginner’s guide to Gutenberg blocks