Can I change the contents of a description meta tag generated by Yoast?

Take a look at WordPress SEO API Docs it appears you can modify the meta description tag will somthing like: add_filter(‘wpseo_metadesc’, function($description){ if ($wtv_language == ‘wtv’) { $description = “my other language meta description here”; } return $description; }); Note that $wtv_language == ‘wtv’ would need to be replaced with whatever function/variable you’re using to … Read more

How to speed up admin-ajax.php in wordpress

Here’s the answer you’re searching for: Ajax takes 10x as long as it should/could Unfortunately, the solution there involves very detailed knowledge of what parts to load / what not to load and why stuff would break. Reading through github issues / comments, it seems this doesn’t work with HTTPS. Otherwise, you really can’t speed … Read more

How can I add tinymce editor in WordPress with jQuery?

This is a good use case for the JS version of the editor introduced in 4.8: https://make.wordpress.org/core/2017/05/20/editor-api-changes-in-4-8/ A new editor API was added in #35760. It makes it possible to dynamically instantiate the editor from JS. Here’s an example of how it’s used (stolen from Rheinard Korf’s example here): // Remember to wp_enqueue_editor(); inside PHP. … Read more

Update PHP version 5.3 to 7.2 or first WP 4.7.11 to 4.9.8?

You should update both. ASAP. PHP 5.3 us not supported for over 3 years… So it may have security vulnerabilities… AFAIR there are no known vulnerabilities in WP 4.7.11, but… It’s an old version too… WP 4.7.11 should work fine on PHP 7.2 and WP 4.9.8 should also work on PHP 5.3 (but at least … Read more

Renaming post IDs – Okay to do?

Is it possible to change the post IDs within the wp_posts table without causing problems? No it is not. If you change a posts ID, you then have to go through and fix other things: the post meta key/value pairs would no longer have the correct ID All terms in taxonomies such as categories and … Read more

How to limit the content coming from wordpress shortcodes?

It’s better to 1st save the returned XML to a file and then loop back to unset. <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => “http://www.cpac.ca/tip-podcast/jwplayer.xml”, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => “”, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => “GET”, CURLOPT_HTTPHEADER => array( “cache-control: no-cache”, “postman-token: 28025ee8-1e82-ce60-f6ae-f401118baa1c” ), )); $response = … Read more