How To Get The Post ID By Post Meta Value

sometimes we need to find post id by post meta key & value. below is function that really helps to find that post ID by meta key & value.

put this function in your function.php file :


How to use this function :

you call this function and pass the meta key and meta value and its return the post id.


I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – we are here to solve your problems.

I, Dayanand Saini,the founder and chief editor of,have been working as a software engineer from last 4+ years. It's my hobby to learn new things and implement on live environment.

One Reply to “How To Get The Post ID By Post Meta Value”

  • I have read some good stuff here. Definitely
    worth bookmarking for revisiting. I wonder how a lot attempt
    you set to create this kind of great informative web site

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 4 =

%d bloggers like this: