diff --git a/frappe/website/website_generator.py b/frappe/website/website_generator.py index 08bf0b4c4c..509a01033c 100644 --- a/frappe/website/website_generator.py +++ b/frappe/website/website_generator.py @@ -94,7 +94,7 @@ class WebsiteGenerator(Document): self.send_indexing_request("URL_DELETED") # On deleting the doc, remove the page from the web_routes index if self.allow_website_search_indexing(): - remove_document_from_index(self.route) + frappe.enqueue(remove_document_from_index, path=self.route, enqueue_after_commit=True) def is_website_published(self): """Return true if published in website"""