do_shortcode: get_page_by_title deprecated | WordPress.org

[ad_1]

It looks like you or the contact form plugin are using an outdated function, ‘get_page_by_title’, which has been deprecated since WordPress version 6.2.0. As a result, you are receiving a PHP Deprecated warning message.

To resolve this issue, you can update your code by replacing the deprecated function with ‘WP_Query’. The ‘WP_Query’ function is the current method for retrieving pages by title in WordPress. Here’s how you can modify your code:

To fix the issue, you can modify your code as follows:

<?php
$args = array(
    'title' => 'Verzoek wijzigen contactgegevens bestrijders',
    'post_type' => 'page'
);
$query = new WP_Query( $args );
echo do_shortcode( '[contact-form-7 id="13223" title="Verzoek wijzigen contactgegevens bestrijders"]' );
?>

This code will retrieve the page with the title ‘Verzoek wijzigen contactgegevens bestrijders’ and display the contact form using the ‘do_shortcode’ function.

For further information on WP_Query, you can refer to the official WordPress documentation: .

Additionally, since it is related to Contact Form 7, I recommend creating a support topic in the Contact Form 7 support forum here: . They have a team of experts who can help you with any issues you’re experiencing.

Thanks!

Thank you so much! You are right, it is related to CF7 because we use an older version because of another issue with the plugin. Thanks again for your support!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer