• Resolved smedina0

    (@smedina0)


    Hello!

    I’m using the “aioseo()->meta->metaData->getMetaData($post)” function to get the title and description of a post, it returns the fields but when I am using a smart tags it does not replace it with its value correspondent:

    This is what it returns to me:

    Custom title #separator_sa #site_title.

    Technical data:
    Plugin version: 4.5.3.1
    WordPress version: 6.1.4
    PHP: 8.0.22

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @smedina0,

    That function is meant to return raw values. You can pass the title and description through this function to convert smart tags into their proper values.

    aioseo()->tags->replaceTags( $title, $postId ) );

    Let me know if that helps.

    Thread Starter smedina0

    (@smedina0)

    Hello @arnaudbroes

    1. I have tested the code you share with the following steps:

    $title = aioseo()->meta->metaData->getMetaData($post);
    // return "Page title #separator_sa #site_title"

    2. Then use this variable in the following function:

    aioseo()->tags->replaceTags( $title->title, $post->ID );
    // return "Page title | Title of my site"

    With these steps it works correctly for me.

    Thank you so much.

    Plugin Author arnaudbroes

    (@arnaudbroes)

    No problem, glad we were able to sort this out!

    This error has been driving me nuts! How would a non-coder go about adding the snippet(s) to correct the problem?

    Plugin Support Prabhat

    (@prabhatrai)

    Hey @susanee,

    Since this topic is already resolved, please open a new one using the link below and share some more details about the error you’re getting so we can assist you better –

    https://www.ads-software.com/support/plugin/all-in-one-seo-pack/#new-topic-0

    We’re looking forward to helping you.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘error in “aioseo()” function, does not replace smart tags in meta data’ is closed to new replies.