I needed to export a table of all posts with their categories and tags for the team to update ready to import back into WordPress with WP All Import. This is the query I used. This is great, thank you! How would you include meta values custom fields as well?
Most Popular Articles
Since the sitemaps were generated by the Yoast SEO plugin, the first thing I did was to look up its configuration settings to see if there already was an option to exclude a specific category. All I had to do was retrieve a comma-separated list of post IDs to put into that textbox. May 2, May 2,
Get all posts by one or more categories
Codex tools: Log in. For instance, it may become necessary to JOIN WordPress tables to determine which posts should be displayed, or you may want to use data stored in your own tables to determine which posts should be displayed. The practical example, outlined below, demonstrates a process of selecting all posts with a particular Custom Field value stored, and displaying them in a Page based on a Page Template. Originally, this code was used to implement a post tagging plugin , which allowed organizing posts in less structured collections than the WordPress Categories. Your own usage may be very different, but the content and example should still give you a useful introduction to the general process involved. To begin with, it is necessary to retrieve the recordset containing the posts you want to display.
It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. Figured it out.