wordpress run php code in page

Create a new page or edit an existing one in the WordPress admin dashboard. Switch to the text editor mode instead of the visual editor. Insert your desired PHP code using the following format:

Preview or publish the page to see the PHP code executed on the front-end.