Looking into this, the CF7 REST addon sort of works. Visitors can still send messages normally, but the resulting success or error messages are not displayed on the page. Presumably this is because there is some other REST-requiring behavior for the success/error messages.
As a note to self: the CF7 REST addon is very simple:
function disable_wp_rest_api_post_var($var) {
return '_wpcf7';
}
add_filter('disable_wp_rest_api_post_var', 'disable_wp_rest_api_post_var');
It hooks into the following code in Contact Form 7:
function disable_wp_rest_api_allow_access() {
$post_var = apply_filters('disable_wp_rest_api_post_var', false);
if (!empty($post_var)) {
if (isset($_POST[$post_var]) && !empty($_POST[$post_var])) return true;
}
return false;
}
And the above does work fine. Users can send messages. The problem is that somewhere CF7 also needs REST access to display success and error messages while users interact with the form. I spent some time digging around CF7 and it seems like any solution will need to happen on the CF7 side of things. Just not something possible from within the Disable WP REST API plugin.
I will keep my eyes on it, and likewise if anyone has related/useful infos, please feel free to comment on this thread, or even open a new one.
Thanks again @marknopfler, for reporting and feedback.