Build
Queries
From plugin v1.37.13
Filters & Custom Queries
This page covers MisePress post types and taxonomies, archive filtering, and how to build custom WP_Query calls.
Post type
| CPT | Slug | Purpose |
|---|---|---|
| Recipe | mp_recipe | Full recipes with ingredients, steps, equipment, nutrition, schema |
Taxonomies
| Taxonomy | Slug | Applies to |
|---|---|---|
| Allergen | mp_allergen | Recipes |
| Ingredient | mp_ingredient | Recipes |
| Cuisine | mp_cuisine | Recipes |
| Course | mp_course | Recipes |
Archive URL filters
MisePress archive pages accept query string filters. Combine any of these with the post-type archive URL (e.g. /recipe/).
| Param | Example | Effect |
|---|---|---|
mp_cuisine | ?mp_cuisine=italian,french | Filter by cuisine slug(s) |
mp_course | ?mp_course=mains | Filter by course slug(s) |
mp_ingredient | ?mp_ingredient=tomato | Recipes containing ingredient |
mp_allergen_excl | ?mp_allergen_excl=gluten,dairy | Exclude posts tagged with allergen(s) |
mp_diff | ?mp_diff=easy | Difficulty filter (recipes) |
mp_time | ?mp_time=30 | Total time ≤ N minutes |
mp_servings | ?mp_servings=4 | Servings filter |
mp_q | ?mp_q=ramen | Free-text search |
mp_sort | ?mp_sort=rating | Sort: recent, rating, popular, quick |
These are also driven by the front-end filter bar; any URL combination is bookmarkable.
Custom WP_Query example
Recent published recipes that contain "tomato" but not the gluten allergen:
$q = new WP_Query( array(
'post_type' => 'mp_recipe',
'posts_per_page' => 12,
'post_status' => 'publish',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'mp_ingredient',
'field' => 'slug',
'terms' => array( 'tomato' ),
),
array(
'taxonomy' => 'mp_allergen',
'field' => 'slug',
'terms' => array( 'gluten' ),
'operator' => 'NOT IN',
),
),
'meta_query' => array(
array(
'key' => '_mp_total_time',
'value' => 30,
'compare' => '<=',
'type' => 'NUMERIC',
),
),
) );
Smart collections in code
Use the [misepress_collection] shortcode or call the underlying helper:
echo do_shortcode( '[misepress_collection preset="popular" count="6"]' );
Available presets: popular, trending, quick, top-rated, new. Tune ranking with the misepress/ranking/weights filter.
Useful meta keys
| Meta key | Type | Meaning |
|---|---|---|
_mp_prep_time | int | Prep time in minutes |
_mp_cook_time | int | Cook time in minutes |
_mp_total_time | int | Computed total time |
_mp_servings | int | Servings |
_mp_difficulty | string | easy / medium / hard |
_mp_rating_avg | float | Average user rating |
_mp_rating_count | int | Number of ratings |
_mp_views_30d | int | Recent view counter |
_mp_nutrition | array | Calories/protein/carbs/fat per serving |
_mp_equipment | json | Equipment required (name, note, optional URL) |
Treat these as read-only when possible; MisePress writes them on save.
Product context
Need the high-level overview? Start with MisePress Recipes, the WordPress recipe plugin.