PHPackages                             davidwebca/acf-block-save-to-meta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. davidwebca/acf-block-save-to-meta

AbandonedArchivedPackage[Database &amp; ORM](/categories/database)

davidwebca/acf-block-save-to-meta
=================================

Adds a setting to ACF fields to allow saving the data to post meta.

0.2(3y ago)611MITPHPPHP &gt;=7.1.3

Since Aug 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/davidwebca/acf-block-save-to-meta)[ Packagist](https://packagist.org/packages/davidwebca/acf-block-save-to-meta)[ RSS](/packages/davidwebca-acf-block-save-to-meta/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

⚠️ NOT NECESSARY ANYMORE
========================

[](#️-not-necessary-anymore)

Since [ACF 6.3 released on May 22nd 2024](https://www.advancedcustomfields.com/blog/acf-6-3-0-released/), it is now possible to save a block's meta with a core flag in block.json. Please update to a new version and use that instead. This repo will gladly never get touched again.

ACF Block Save To Meta \[WIP\]
==============================

[](#acf-block-save-to-meta-wip)

Allows adding a setting to ACF fields to save the field's data to wp\_postmeta. This is a work in progress, use at your own risk.

WARNING
-------

[](#warning)

The official ACF team has mentionned that they would add this in core relatively soon. You can follow the related issue [here](https://github.com/AdvancedCustomFields/acf/issues/83).

Requirements
------------

[](#requirements)

- [Composer](https://getcomposer.org/download/)

Installation
------------

[](#installation)

Install via Composer:

```
$ composer require davidwebca/acf-block-save-to-meta
```

If your theme already uses composer, the filters will be automatically added thanks to the auto-loading and auto-instantiating class. Otherwise, if you're looking for a standalone solution, copy src/ACF\_SaveToMeta.php to your theme's folder and include it in functions.php.

Instructions
------------

[](#instructions)

Every field you need to have saved to post meta needs to have its option checked to "yes" in the field's settings. Fields that don't have this option checked will be ignored and saved normally to the block's meta block in the post content.

Known issues
------------

[](#known-issues)

Currently, this code doesn't check if multiple of the same block or if multiple fields have the same name. If multiple blocks have the option "Save to meta" enabled, or if multiple of these blocks have identical field names, the latest one added to the editor will be the prevalent data, thus the one that will be saved to meta.

A future solution might be added to never allow saving to meta when "multiple" isn't true, but it is currently impractical or impossible to implement.

Also, you'll have to use the regular "get\_post\_meta()" outside of the post's single (in loops etc.) to get the data because ACF currently looks up field values with "get\_field" which passes through some location validation. Since our field is not associated to the post, but to a block on the post, it doesn't always return the right value, especially if you're migrating from a real post (meta) location to a block.

Bug Reports and contributions
-----------------------------

[](#bug-reports-and-contributions)

All issues can be reported right here on github and I'll take a look at it. Make sure to give as many details as possible since I'm working full-time and will only look at them once in a while. Feel free to add the code yourself with a pull request.

License
-------

[](#license)

This code is provided under the [MIT License](https://github.com/log1x/sage-directives/blob/master/LICENSE.md).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~58 days

Total

2

Last Release

1297d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db74579a207132c752a23856990f4ea0580835db57f819e28c3bf38ee35ba020?d=identicon)[davidwebca](/maintainers/davidwebca)

---

Top Contributors

[![davidwebca](https://avatars.githubusercontent.com/u/412352?v=4)](https://github.com/davidwebca "davidwebca (6 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/davidwebca-acf-block-save-to-meta/health.svg)

```
[![Health](https://phpackages.com/badges/davidwebca-acf-block-save-to-meta/health.svg)](https://phpackages.com/packages/davidwebca-acf-block-save-to-meta)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M545](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
