public function execute() { $resultPage = $this->resultPageFactory->create(); // Handling page title $resultPage->getLayout()->getBlock('page.main.title')->setPageTitle('Page title here'); // Handling meta_titleJust tried myself for a new custom extension, meta_description and meta_keywords $resultPage->getConfig()->getTitle()->set("Title"); $resultPage->getConfig()->setDescription("Description"); $resultPage->getConfig()->setKeywords("Key Words"); return $resultPage; }it works for me :
public function execute() {
$resultPage = $this->resultPageFactory->create();
// Handling page title
$resultPage->getLayout()->getBlock('page.main.title')->setPageTitle('Page title here');
// Handling meta_title, meta_description and meta_keywords
$resultPage->getConfig()->getTitle()->set("Title");
$resultPage->getConfig()->setDescription("Description");
$resultPage->getConfig()->setKeywords("Key Words");
return $resultPage;
}
It shoud do the job !