How to edit codes of an individual page/post?

You want to hook into the Header code using something like this:

add_action('wp_head','hook_javascript');

function hook_javascript() {
    if (is_single('123')) { 
        $output="<script> enter your script here </script>";
        echo $output;
    }
}

More information available here: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

Leave a Comment