> For the complete documentation index, see [llms.txt](https://docs.woohoo.dance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.woohoo.dance/dynamic-data/display-recently-viewed-products.md).

# Display recently viewed products

You can use Post loop builder to show recently viewed products. Follow these steps:

1. Add Post loop builder
2. Select Query > Array \
   ![](/files/ZMy7tS6j7CwSQWVLmbZM)
3. Enter this array:

```php
return [
'post_type' => 'product',
'posts_per_page' => 4,
'meta_key' => '_last_viewed',
  'orderby' => 'meta_value',
'order' => 'DESC',
];
```

Important part is meta\_key "*last\_viewed".*&#x20;
