What is the best way to cache pages on WordPress

No, there isn’t. WordPress does not provide page caching mechanisms, and has no APIs for it. There is no generic way to say example.com/page is now stale and needs recreating. Nor is there any generic way to pre-generate every page short of visiting them all. Every plugin uses a different solution with different APIs and … Read more

Can inactive WordPress plugins still load scripts?

Many hypotheses could be made, but the most probable ones are that the theme or a third plugin loads the script if a specific option saved in the database has a certain value. If the plugin is installed but not active that hypothetical option still exists in the database, on the contrary, when you delete … Read more

How to set category correctly for a custom post created by a remote API call?

Functions like get_cat_ID and get_category_by_slug only work for core post categories (taxonomy category) – you are dealing with a custom taxonomy todocategories. I see you have $a2zq3_cat_name=”Category-name”; hardcoded near the top, so I assume you’re not assigning the todocategories from POST data. In which case just use wp_set_object_terms() like so. wp_set_object_terms( $a2z3_entry_post_id, [ ‘the-category-slug’ ], … Read more

Is there a plugin for automatically adding a word or symbol after a trigger word? I.e. Like a search and replace but more like search and add? [closed]

This would run a find-and-replace on displaying the title and content field: function wpse_406537_search_replace( $content ) { $company_name=”The Company”; $company_name_regex = preg_quote( $company_name, “https://wordpress.stackexchange.com/” ); // Best-guess attempt at replacing company name that doesn’t yet have ™️ // e.g. The Company[space] // e.g. The Company. // e.g. The Company, // e.g. The Company[end of string] … Read more

How to remove js ui library added by default by wordpress

The related library is registered with a function called wp_default_scripts. File location (for WordPress 6.0): …wp-includes/script-loader.php remove to remove the relevant script; The add function is used to add a new script. /** * Assigns default styles to $styles object. * * Nothing is returned, because the $styles parameter is passed by reference. * Meaning … Read more

When I try to de-activate any plugin it gives error “Warning: call_user_func_array() [function.call-user-func-array]”

The Youtuber plugin has a little error: it has a function to remove it’s own options, called wp_youtuber_uninstall. However, it hooks into the deactivate_plugin option with the function youtuber_uninstall, which does not exist. This has been reported in the WP support forums. You can remove the line that says add_action(‘deactivate_plugin’, ‘youtuber_uninstall’ ); to get rid … Read more