Duplicate page in wordpress

im developing custom theme on my own without using page builders with custom filed like ACF, when i duplicate any pages with custom fields. I want to get all custom field (ACF) on duplicate page but im unable to get custom field on duplicate page. how can i get all field of current page on duplicate page…???

i got solution, template help to get desire result, any other solution are heartly welcome

When duplicating a page with custom fields created using Advanced Custom Fields (ACF) in a custom theme without using page builders, you may encounter issues retrieving the custom field data on the duplicated page. This happens because the custom fields are tied to the original page’s ID, and duplicating the page generates a new ID for the duplicate.

To retrieve the custom field data on the duplicated page, you can follow these steps:

  1. Identify the ID of the original page.
  2. Duplicate the page using a suitable method or plugin.
  3. Retrieve the custom field data from the original page using the ACF get_field() function, passing the original page’s ID.
  4. Assign the retrieved custom field data to the duplicated page using the ACF update_field() function, passing the field name and the ID of the duplicated page.

By performing these steps, you should be able to retrieve and assign the custom field data from the original page to the duplicated page.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.