I’m trying to have a contact form on a WordPress page without installing a plugin. I’ve found an example on a website (https://influencerseo.com/how-to-create-a-contact-form-in-wordpress-without-a-plugin) and it adds some PHP code in HTML editor mode on a page.
<form action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>” method=”post”>
The php code is removed by WordPress.
How can I get that admin-post.php action link in my html code ? I want to keep the WordPress install as clean as possible, avoiding when possible, to install plugins and mainly for learning WordPress
What I tried so far:
I installed WPCode plugin to allow PHP but if I add the shortcode of snippet in HTML code, it doesn’t replace the shortcode in rendered page.
I also tried to add shortcode by “add_shortcode(‘contactform_link’, ‘subscribe_link’); but it doesn’t change the shortcode in rendering (subscribe_link function’s return the admin-post.php link like the code above.