To get the id of current CMS page in Magento 2, use the following code snippet.

There are so many other methods to get CMS page details like title, identifier, content, and content heading. Lets check one by one.

To get the identifier of the current CMS page you can use

To get the Page Title :

To get the Page Content :

To get the Page Content Heading:

Thats it. Enjoy Magento 2!! Enjoy Magewallet!!!

Mahendra Paladiya
Mahendra is a Web Developer whose passions includes web development, technical blog writing, and database management. His passion for web development pushed him into learning how to handle different platforms like Core PHP, Magento, Prestashop, WordPress, CodeIgniter, CakePHP and Oracle.