### [Setting a Default Featured Image for Post Submissions](https://wpforms.com/developers/how-to-set-a-default-featured-image-for-post-submissions/)

**Published:** March 11, 2022
**Author:** David Ozokoye

**Excerpt:** This tutorial will show you how to use PHP to set a default featured image for all of your post submissions. 

**Content:**

Would you like to set a default featured image for post submissions? By setting your own featured image for your submissions, you can easily control what image is set when you approve posts submitted through the Post Submission addon.

In this tutorial, we’ll share the custom PHP snippet you’ll need to add to set a default featured image in WPForms.

---

## Creating Your Form

To start, you’ll need to [create a new form](https://wpforms.com/docs/creating-first-form/ "Creating Your First Form") or edit an existing one to access the form builder. For this tutorial, we suggest using our customizable [Sample Post Submission](https://wpforms.com/templates/sample-submission-form-template/) form template to get started quickly.

If you need any help in creating this type of form, [please review this documentation](https://wpforms.com/docs/how-to-install-and-use-the-post-submissions-addon-in-wpforms/ "How to Install and Use the Post Submissions Addon in WPForms").

![create your post submission form](https://wpforms.com/wp-content/uploads/2022/03/wpforms-post-submission-form.jpg)## Finding the Image ID Number

In order to set the default featured image, you’ll need to know the image ID number from your WordPress Media Library.

To retrieve this ID, log in to your WordPress dashboard and go to **Media » Library**. Then, hover over the image you’d like to use.

![WordPress media library](https://wpforms.com/wp-content/uploads/2024/11/wp-media-library.png)At the bottom left corner of the page, you’ll see a URL. The number after the ‘post=’ is the ID for the image. For our example, this number is 2812.

![find the image id number so that you can set a default featured image for every post submission](https://wpforms.com/wp-content/uploads/2024/11/copy-image-id.png)Note this number, as we’ll need it for the next steps.

## Adding the Snippet

Now, it’s time to add the snippet to our site. To proceed, you’ll need to add the code snippet below to your site. If you need help with where and how to add snippets to your site, [please check out this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

This snippet will only run on the form ID **463**. You’ll need to update this ID to match your form ID. For any assistance in finding your form ID number, [please visit this tutorial](https://wpforms.com/developers/how-to-locate-form-id-and-field-id/ "How to Locate Form ID and Field ID").

**Note:** Using this snippet means that **all** submissions with this form ID will have the exact same featured image set for each post.

Now, for each new post submission entry received, this snippet will set a default featured image.

Next, would you like to email the user submitting the form when the post is published? Take a look at our tutorial on [how to send email notifications on Post Submission publish](https://wpforms.com/developers/how-to-send-email-notification-on-post-submission-publish/ "How to Send Email Notification on Post Submission Publish").

## Related

Action Reference: [wpforms\_post\_submissions\_process](https://wpforms.com/developers/wpforms_post_submissions_process/ "Using the wpforms_post_submissions_process action")

**Categories:** Tutorials

---

