How to parse Yoast SEO Snippet Variables

Ok here is how I parsed the snippets in case anyone else needs to know $id = get_the_ID(); $post = get_post( $id, ARRAY_A ); $yoast_title = get_post_meta( $id, ‘_yoast_wpseo_title’, true ); $yoast_desc = get_post_meta( $id, ‘_yoast_wpseo_metadesc’, true ); $metatitle_val = wpseo_replace_vars($yoast_title, $post ); $metatitle_val = apply_filters( ‘wpseo_title’, $metatitle_val ); $metadesc_val = wpseo_replace_vars($yoast_desc, $post ); $metadesc_val … Read more

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

Yoast SEO hooks overriding themselves

Filters should be returned even if your condition fails. You are currently just returning the output when your condition is met, not when it fails. return $string; at the end of each function should solve your issue. EXAMPLE add_filter(‘wpseo_canonical’, ‘listpagecanonical’); function listpagecanonical($string) { if (is_page(1)){ //I do my stuff here return ‘http://canonicalurl.com’ } return $string; … Read more

make the url unlimited

You might think it’s 39 characters long, but it’s actually 332 characters long. This is the real URL you’re trying to use: https://sitename.com/%D8%A8%D8%B1%D9%85%D8%AC%D8%A9-%D8%AA%D8%B5%D9%85%D9%8A%D9%85-%D9%85%D9%88%D9%82%D8%B9-%D9%85%D8%B1%D9%83%D8%B2-%D8%B1%D9%81%D8%B9-%D8%AA%D8%AD%D9%85%D9%8A%D9%84-%D8%AA%D8%B7%D8%A8%D9%8A%D9%82-%D8%AA%D8%B7%D8%A8%D9%8A%D9%82%D8%A7%D8%AA-%D8%A7%D9%8A%D9%81%D9%88%D9%86-%D8%A7%D9%86%D8%AF%D8%B1%D9%88%D9%8A%D8%AF/ But Those Aren’t Arabic Characters?! There’s no such thing as a true Arabic URL. HTTP requests don’t use unicode, and the RFC that determines a valid URL doesn’t include non-latin characters. Then … Read more

XML Sitemap : broken XML file [closed]

This seams to be an issue with the header(‘HTTP/1.1 200 OK’) function call in Yoast’s WordPress SEO plugin that is not compatible with my server configuration (Nginx with some security config in front, then apache for php processing). In some way I do not fully understand, this php function call was forcing the server to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)