To add custom code to a specific page in WordPress, you need to first identify the page’s ID. To find the page ID, go to Pages in the WordPress dashboard and hover over the page you want to add code to. The ID number will appear in the URL at the bottom of your browser. You can also click on Edit, and then see the post ID in the URL in the browser.

Once you have the ID number, you can use the following code snippet to add code to the site:
add_filter( 'the_content', 'wpsnippets_add_code_to_page' );
function wpsnippets_add_code_to_page( $content ) {
// Check for the page ID
if ( is_page( 123 ) ) {
// Add custom HTML to the content
$custom_html = '<div class="custom-content">Custom HTML content goes here.</div>';
$content .= $custom_html;
}
return $content;
}