• Resolved oweux

    (@oweux)


    Hello and Thank you in advance for your help.

    When we use “update_post_meta” we are able to save data to

    _yoast_wpseo_title
    _yoast_wpseo_focuskw
    _yoast_wpseo_metadesc

    like this: update_metadata($id, ‘_yoast_wpseo_title’, ‘value-to-save’);

    We are then able to retrieve that data without issue.

    The problem we have is that the data we save does not appear on Yoast’s edit fields on the item in question. When we look at the page’s source code it is not there either.

    Data is not recorded to ‘yoast_indexable’ when using update_metadata — Only to ‘termmeta’.

    Data entered using the “editor” and pressing update/publish does get recorded properly and appears on both ‘yoast_indexable’ and thus on the page’s source code.

    We are using the most up to date version of WP (Version 5.5.3) and YoastSEO (15.3).

    About 7 months ago Collins Agbonghama asked (https://yoast.com/yoast-seo-14-0/) if this would continue to work to which the answer was “yes”. We have been unable to find if it still should work or if there is now another process.

    Thank you again and for your insights into we might be doing wrong.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    We are sorry to hear that you are having trouble with our plugin. Can you please confirm whether the issue persists after resetting the Indexables and migrations by using the Yoast Test Helper plugin after updating the post meta?

    • Go to Tools → Yoast Test → Yoast SEO → Reset Indexables tables & migrations options to reset it.
    • Run the SEO data optimization again from the SEO → Tools page to see whether this resolves the issue for you.
    Thread Starter oweux

    (@oweux)

    Hello! I did not see your message until today. Sorry about that.

    What I did do is to, through the CLI, force a re-indexing. It took a while and completed successfully. I will go ahead and do as you request.

    • This reply was modified 3 years, 10 months ago by oweux.
    Thread Starter oweux

    (@oweux)

    When I visited “Go to Tools → Yoast Test → Yoast SEO → Reset Indexables tables & migrations options” I had a button that seems to be what you suggest as part two “Run the SEO data optimization again from the SEO → Tools page”.

    do you think re-indexing through the CLI took care of the 1st step? or was it a coincidence?

    I now see “Optimizing SEO data… This may take a while.” and will leave it alone for a few hours.

    Should it all start working properly after this?

    Is this something that is needed each time after updating through the use of “update_post_meta” ?

    Thread Starter oweux

    (@oweux)

    The process completed and now… what is the expectation. Should I use “update_post_meta” and things get updated automatically or I need to go through these steps each time I use “update_post_meta”?

    • This reply was modified 3 years, 10 months ago by oweux.
    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Reindexing the SEO data through the WP-CLI will also fix the issue. So, it wasn’t a coincidence. If that resolved the issue for you, there’s no need to run the SEO data optimization from the SEO → Tools page again.

    On the other hand, once the relevant analysis is completed either from the WP-CLI or from the SEO → Tools page, the expectation would be to see the correct data that you have already added/updated through update_post_meta() function.

    Can you please confirm whether this resolves the issue for you?

    Thread Starter oweux

    (@oweux)

    Hello mazedulislamkhan,

    This did not correct the issue.

    update_post_meta() reports success (and failure as and when expected).

    After running update_post_meta() on a single on a woocommerce category, the yoast indexable tables are not updated. Refreshing the “edit” page for the category does not reflect the changes. The only way I can updated the indexables is by manually making changes and saving.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Thanks for your confirmation. It looks like a bug report is already opened in our development repository for this issue. You can find it here https://github.com/Yoast/wordpress-seo/issues/15449.

    Can you please confirm whether this is the same issue that you are currently experiencing here? If yes, we recommend you please make a comment on the relevant issue to get the latest update from our development team for the relevant issue.

    Thread Starter oweux

    (@oweux)

    mazedulislamkhan,

    It is similar, but not quite the same. We are not running in ‘multi’ mode. we actually have is explicitly disabled by setting the multi mode constant to false (we read that post some time ago). We tried doing that because we do not need to be in that mode and it did not resolve the issue.

    By “manually saving” do they mean pressing “update” or is there an additional function you recommend we run after update_post_meta() to make sure things are being written?

    When we press “update” what gets saved is what is on the page. refreshing never brings the “new” values, neither does clearing caching (but this should not be necessary).The new values appear on the wp+commerce built-in tables but never make it to your indexable tables.

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    By ‘manually saving’ they do mean pressing the ‘update’ button when editing the page. It looks like a separate bug report was already reported on our private repository on JIRA, which included this forum thread, but it’ll need further investigation and is on the backlog. Please do check the changelog in new releases of the Yoast SEO plugin from time to time for any updates on this concern.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘update_post_meta not working as expected’ is closed to new replies.