I would like to get the id of a post by title.
The script below shows the content of a post by id.
$content_post = get_post($postID);
$content = $content_post->post_content;
return apply_filters('the_content', $content);
Can you please check this code?
$page = get_page_by_title(' Your page title '); // enter your page title $pageID = $page->ID; echo $pageID;
for more information you can refer this link get_page_by_title ?