get wordpress page id code example Example 1: get wordpress id echo get_the_ID(); Example 2: get the current page id in wordpress $page_id = get_queried_object_id();