Tobys
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [Yoast SEO] Change meta with code – article:modified_time and datePublishedFor anyone curious, this is the solution I came up with. If anyone can spot weaknesses or a better solution, then please let me know.
<?php use Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter; function remove_wp_seo_presenters( $filter ) { if (($key = array_search('Yoast\WP\SEO\Presenters\Open_Graph\Article_Modified_Time_Presenter', $filter)) !== false) { unset($filter[$key]); } return $filter; } add_filter( 'wpseo_frontend_presenter_classes', 'remove_wp_seo_presenters' ); class Custom_Presenter extends Abstract_Indexable_Presenter { public $property; public $content; function __construct($property, $content) { $this->property = $property; $this->content = $content; } public function present() { return '<meta property="' . esc_attr( $this->property ) . '" content="' . esc_attr( $this->content ) . '" />'; } public function get() { return null; } } function add_custom_presenter( $presenters ) { $modified_time = new Custom_Presenter("article:modified_time", "2020-11-10"); $presenters[] = $modified_time; return $presenters; } add_filter( 'wpseo_frontend_presenters', 'add_custom_presenter' ); ?>
If you delete reCAPTACHA prepare for a TON of spam!!!
I switched to another form solution – SO happy!
Sorry for late answer, replys went to my spam mail.
I am using a dedicated VPS hosting, I have other WordPress sites that are working fine. Latest version of PHP 7.2
Forum: Plugins
In reply to: [Yoast SEO] Manually write meta description with wpseo_metadescLol I just found the error:
I used wpseo_metakey instead of wpseo_metadesc
Viewing 4 replies - 1 through 4 (of 4 total)