There is a static page assign for profile page under option page, you can check is the current page is profile page or others page by the following the code sample.
add_action('wp_head','is_user_profile_page'); function is_user_profile_page(){ $user_profile_page_id = get_option('user_profile_page_id'); $current_page_id = get_the_ID(); if($user_profile_page_id == $current_page_id){ // execute your code here on profile page... var_dump($user_profile_page_id); }else{ // others page code here } }