I want to change category page after filter opens any page and change Title, MetaTitle, MetaDescription in after search result.

What can I do ..and any observer this possible ?enter image description here

1 Answer 1


add this observer code in controller_action_postdispatch


namespace ABC\Seo\Observer;

class FileName implements ObserverInterface
    protected $context;
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,

    ) {
        $this->context = $context;
    public function execute(\Magento\Framework\Event\Observer $observer)

        //your code 
        $layout = $this->context->getLayout();
        $pageMainTitle = $layout->getBlock('page.main.title');


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.