Support » Plugin: Yoast SEO » Meta Descriptions for dynamic pages

  • Hello,

    first of all, thanks for your plugin and your support.

    Now to my problem… I have a couple of dynamic WP Pages, which pull data from non-wp tables and show them. Like browsing a videos/books/games database which gets managed through a custom CMS.
    Since the shown data has nothing to do with WP and WP just loads the same page over and over again, there are no real title / description tags to show for your plugin.
    Now I would like to know which filters / actions i have to call from my functions.php to give your plugin the data for Meta Description.

    Thanks for your help in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Have you looked here?

    This seems to be exactly what I was looking for.
    Thank you, thank you, thank you!!!

    Ok this seems to be the answer to my question, but I am expiriencing problems with the API functionality.

    using this function to use a custom meta desc for my dynamic content pages:

    function yoastMetadesc($defaultMeta) {
    		case "xyz":
    			$x = ($wp_query->query_vars["x"]) ? $wp_query->query_vars['x'] : "x";
    				case "y":
    					return "123";
    					return "custom default desc";
    			return $defaultMeta;
    add_filter( 'wpseo_metadesc', 'yoastMetadesc', 10, 1 );

    My problem now is that my custom meta desc only gets shown on the frontpage. there is no meta desc inside my blog postings or on my dynamic pages 🙁 Only if I enter something manually inside the meta desc box widget inside on the “edit page” page. shouldnt it display the excerpt if I dont enter something manually?

    All templates use the same header.php, which calls wp_head(), so this is not the problem.

    Can somebody tell me what the problem is? Why isnt the meta desc populating inside my blog postings?

    What are your settings on the SEO->Titles & Meta page ?
    If the meta description box there is empty, no meta description will be added and the filter will not be called/run.

    Hmmmm, not sure if this is what I want to achieve…

    On articles, I want the articles excerpt to be the meta description (which is the default behavior of this plugin AFAIK). On Pages, it should be the custom meta description, which I want to define via the function posted above.

    I now filled the fields you mentioned with default meta descriptions & titles, but they are now shown on every article/page, instead of the excerpt.

    What am I missing?

    I’m not sure I understand completely what’s going on now. Are you using the %%excerpt%% variable or not ? If you’re unclear on how to fill in the templates, have a look at the Help tab.

    Otherwise, if that’s not the issue, could you show me a screenshot of what you’ve entered in the SEO->Titles & Meta’s settings now ?
    And may be give me a link to one of the offending pages/posts ?

    No no, the problem was something different, but I managed to fix it now… I removed the default parameter from the function and used the global $pagename var – now it works.


    This one solved my problem for the articles tho – big thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Meta Descriptions for dynamic pages’ is closed to new replies.