> 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 \
   ![](https://1072142691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00iTFjPG4OvCmS1VumHy%2Fuploads%2FXpLdY7RB9VfFG7c2KOqq%2Fimage.png?alt=media\&token=19dcd9da-912f-4fb4-a6a7-a4fa6b28c1f0)
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;
