Home>Support>How i can update post content programmatically
  1. 1 year, 2 months ago Alex S Hi, I Work Here

    Hi Amine,

    This is possible, but it’s quite a complicated process to achieve. We’re unfortunately only able to provide a limited outline due to the complexity of this task. If you’re not very familiar with PHP, I recommend hiring a developer to assist you with this. We recommend using Codeable.

    To do this you’ll need to:

    Get the post content of the page you wish to update programmatically.
    Parse and filter the blocks added to the content until you find the SiteOrigin Layout block.
    Process the raw layout of the block and then iterate that layout until you find your widget.
    Make your desired changes, and then save the layout (here’s an example of how to do this).
    For SEO reasons, you should update the SO Layout Attribute.

    Kind regards,

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More