Is it possible to get an array of all post IDs currently present in the wordpress DB (irrespective of post_types)?
Also, is it possible to get an array of all post IDs of a specific post_type?
If we can, how to achieve that?
Is it possible to get an array of all post IDs currently present in the wordpress DB (irrespective of post_types)?
Also, is it possible to get an array of all post IDs of a specific post_type?
If we can, how to achieve that?
You must be logged in to post a comment.
You can try this way
probably best to run a custom query using the DB object of wordpress. (from functions.php or a theme file etc):
I think in fact you can get that also with standard wp_query object…. but at least my way you could make the query in phpmyadmin first, then adjust for the syntax/wordpress prefix. (read the codex on DB object) . If it is a one-off just use phpmyadmin, but for programmatic use you should then convert it to run from your functions.php file.