Title: Add metas programmatically
Last modified: January 29, 2021

---

# Add metas programmatically

 *  Resolved [marnyscom](https://wordpress.org/support/users/marnyscom/)
 * (@marnyscom)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/add-metas-programmatically/)
 * Hi,
    I would like to know if is there any way to insert and update meta title
   and meta description programmatically (for posts and terms). I am trying to do
   it with wpdb insert into ‘yoast_indexable’ table, but I see that is not the right
   way. Thank you.
    -  This topic was modified 5 years, 4 months ago by [marnyscom](https://wordpress.org/support/users/marnyscom/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Michael Tiña](https://wordpress.org/support/users/mikes41720/)
 * (@mikes41720)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/add-metas-programmatically/#post-13973996)
 * Hi [@marnyscom](https://wordpress.org/support/users/marnyscom/)
 * We understand you would like to insert and update the title and meta description
   programmatically.
 * We don’t recommend to automatically fill in any sort of SEO data as this won’t
   be helpful for the websites in the search results. If possible, we always recommend
   users to take time and manually go through all the pages available on the site
   for manual optimization as this could really help the website to gain rank in
   the search results.
 * With that being said, if you still want to automatically fill up the SEO data,
   you can try looking for the relevant solution in our documentation on our developer
   portal here — [https://developer.yoast.com/](https://developer.yoast.com/).
 * Most of our hooks, filters, APIs, and code examples are available on there. We
   hope this points you in the right direction!
 * You might also want to consider just using the snippet variables to automatically
   generate SEO titles and meta descriptions for your content types — [https://yoast.com/snippet-variables/](https://yoast.com/snippet-variables/)
    -  This reply was modified 5 years, 4 months ago by [Michael Tiña](https://wordpress.org/support/users/mikes41720/).
 *  [rmisaki](https://wordpress.org/support/users/rmisaki/)
 * (@rmisaki)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/add-metas-programmatically/#post-13977101)
 * I could change stuff programatically via the wpseo_register_var_replacement function
   inside my plugin, there’s a tutorial from the web here:
 * [https://maheshwaghmare.com/doc/yoast-seo-custom-template-variable/](https://maheshwaghmare.com/doc/yoast-seo-custom-template-variable/)
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/add-metas-programmatically/#post-13977494)
 * [@rmisaki](https://wordpress.org/support/users/rmisaki/) Unfortunately we can’t
   offer support on custom code. Since we don’t want to take the risk that we break
   your website by suggesting incorrect or incomplete code, we cannot advise you
   on how to make such changes. Maybe someone watching these forums can assist you
   further, but if your topic is inactive for 7 days, we’ll mark it as resolved 
   to keep the overview.
 * Thank you for your understanding.
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/add-metas-programmatically/#post-14005139)
 * 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 4 replies - 1 through 4 (of 4 total)

The topic ‘Add metas programmatically’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [devnihil](https://wordpress.org/support/users/devnihil/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/add-metas-programmatically/#post-14005139)
 * Status: resolved