---
title: "Custom Message When Query is Empty (Elementor Pro)"
url: "https://wicky.co/custom-message-when-query-is-empty-elementor-pro/"
type: "post"
published: "2022-04-04T08:32:49-04:00"
modified: "2022-04-04T08:32:49-04:00"
author: "wicky"
---

In this quick Elementor Pro tutorial I will show you to add a custom message when a post widget query is empty.

**GitHub Issue (Custom message when Post widget query is empty):**
[https://github.com/elementor/elementor/issues/7624](https://github.com/elementor/elementor/issues/7624)

**Code Snippets Plugin:**
[https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)

**JetSmartFilters Video:**
[https://www.youtube.com/watch?v=fsPYdaqgeGY](https://www.youtube.com/watch?v=fsPYdaqgeGY)

## Function Code:

```

					// empty query text
add_action('elementor/query/query_results', function($query) {
	$total = $query->found_posts;
	if ($total == 0) {
		echo 'No results found.';
	}
});

```
