• Resolved freeriders

    (@freeriders)


    Greetings

    I am currently working on a plugin to create programmatically post using wp_insert_post

    I search for hooks so that I can fill in the same time the values for Yoast SEO, specially the values for facebook title, facebook description and facebook image

    when I have a look at the documentation at

    it looks like one can only manipulate the datas on the front side, but not directly in the db

    thank you in advance for your help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter freeriders

    (@freeriders)

    searching a bit more via mysql, I came accross a solution by using those hooks

    update_post_meta($post_id,'_yoast_wpseo_opengraph-title',$title);
    update_post_meta($post_id,'_yoast_wpseo_opengraph-description',$content);
    update_post_meta($post_id,'_yoast_wpseo_opengraph-image',$image);

    do you think that is the smartest way to do it?

    thank you in advance

    Plugin Support marcanor

    (@marcanor)

    Hello freeriders,

    The API documentation mentions a way to modify the OG tags, but as you mention, it’s only on the frontend. It seems your way would certainly work.

    Please let us know if you have any further information.

    Thread Starter freeriders

    (@freeriders)

    thank for the reply marcanor, yes technically it works, I was just wondering if there was a better way to do it

    cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘fill programaticaly the database’ is closed to new replies.