Returnget featured image using wordpress api
cropped-luca.png

Luca Reale

Content writer

Guides
WordPress

How To Get A Featured Image Using The WordPress API 

September 27, 2022Last Updated: April 14, 2025

When making an API call for a WordPress post, you’ve probably found it frustrating that the response object doesn’t return the URL for the featured image. Fortunately, there are some quick workarounds to get a featured image using the WordPress REST API.

In this article, we’ll explain three methods of using the WordPress API to get a featured image.

Save your file by clicking on Update File at the bottom of the window and then you’re all done!

Method 3: Using the Query Parameter

This method lets you fetch the URL of your featured image using the query parameter ?_embed. You simply add ?_embed at the end of the URL like this:

An example of adding the query parameter at the end of a URL to fetch a featured image with the WordPress API

The response will show you where your featured image is located.

The response from an API call for featured image using the query parameter

With these three methods, you can easily fetch featured images for your post with the REST API. Luckily, it’s pretty straightforward, just remember to be careful when editing the functions.php file and make a backup before changing any site files.

If you’re not confident about changing the functions.php file, you can install and use the Better REST API Featured Images plugin or the ?_embed query parameter to get your featured images.

Book a 30-min Introduction Call

Let's jump on a quick intro call We'll break down your project, and pinpoint exactly how we can help.

gradient backgroundgradient backgroundgradient background

Our clients
Holaa!
love working with us see their stories below!

testimonial-section-img_2x