Looking at the filter:
$post_content = apply_filters( 'wpseo_pre_analysis_post_content', $post->post_content, $post );
it would be a matter of adding your fields content to string being analyzed.
You have to do the get_field()
part right, this is untested:
add_filter( 'wpseo_pre_analysis_post_content', 'filter_yoasts_wpse_119879', 10, 2 );
function filter_yoasts_wpse_119879( $content, $post )
{
$fields = get_field( 'name', $post->ID );
return $content . $fields;
}
As noted by kaiser in comments, the get_field()
function is not reliable. If it is a relatively simple field, it’s better to stick to get_post_meta
.
Related: Where do I put the code snippets I found here or somewhere else on the web?
Related Posts:
- How many filter/action hooks are healthy?
- Earliest hook to reliably get $post/$posts
- Remove Editor From Homepage
- What does (10, 2) mean when used with add_filter
- Valid characters for actions, hooks and filters
- How to check if a hook is hooked or not?
- How to make post and comment count unclickable with dashboard_glance_items hook
- Hook into admin post list page
- How do I know if author field was changed on post save?
- Search with filters and title
- About Hooks and Filters
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- add_action uses ‘echo’ add_filter uses ‘return’, why?
- Too many actions/filters!
- Apply a filter only once
- How to get list of all hooks of current theme / plugin?
- Making a class available via actions filters
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- Filter list by a unique meta value dilemma
- return values from hooks do_action and apply_filters, which is better
- How to get all the predefined do_action() calls from an active theme
- Is it possible to track down Actions and Filters?
- Return a custom value in a function added to an action hook
- Same Conditionals Not Working on Two Different Hooks
- add filter login_redirect does not contain original requested redirect
- get_header and hook avoid normal call
- Can the wp_filter object hold multiple values with the same key
- apply_filters/do_action tag characters limit
- Is there a filter called ‘network_admin_init’?
- How to add ‘total’ value to custom column title on the posts list page
- Filter taxonomy admin pagination
- When to use add_action when registering/enqueuing scripts
- Insert term when page is published – avoid duplicates after edits
- Are there actions or filters I can use for Ajax calls?
- Capture post content before page renders
- Correct method of redirecting user login
- How to remove action with slashes and arrows?
- How do I use remove_action on an add_action that uses an array?
- Changing WordPress core without hacking core
- How to pass variables to custom filter from multiple functions
- Customize title, description and focused keyword [closed]
- Comment search plugin
- Proper after_setup_theme and wp_head cleanup
- the_content filter together with require_once returns 1 instead of the content of the included file
- How to get a single hook from wp_head()?
- Add a filter inside an action init
- How to apply a filter to an ACF wysiwig editor field output?
- Is it possible to apply_filter on a wp_ajax_ action?
- Filter for when the post is updated
- Add a filter to an action [closed]
- How can I specify the post status of an untrashed post?
- Filter get_page_by_path()
- Conflict calling an add_filter() twice
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter Pages by Custom Field (ACF) in admin area
- Remove actions/filters that are set with create_function()
- Most performant/functional way to add actions/filters?
- Remove tags without a specific meta key from “choose from the most used tags”
- Add/remove CRON action depending on variable
- How to access page variable inside action hook
- Create new custom field that calculates age
- Use has_filter on comment_post
- Echo string in admin panel footer beside version no
- How to change default text for specific post type
- How can I edit comment meta value before it is saved?
- Disable sanitize_file_name on upload without modifying functions.php
- Redirect after post deleted
- Making an add_filter() call from within an add_filter() call
- Plugin default settings hook
- alternative to the_content filter
- Action hook to control access to certain parts of my site
- Finding actual functions added to hooks and filters
- How to pass a variable between filter/action functions?
- style_loader_tag not changing stylesheet to preload
- Adding link options in insert/edit link dialog window
- How to redirect a unique link based on login status
- Hook to change the site URL
- how to use apply filter for Class?
- How can I see exactly what arguments are being passed through a filter so that I may modify them?
- WordPress set featured image to first image of the post
- adding an action inside if condition not working
- Using add_filters() , apply_filter(), add_action() and do_action() in extending a plugin
- Action for opening attachment or manipulating all attachment links
- Put data in my-account/view-order/id/ page
- What action/filter can be used for modifying the page to be rendered?
- Hook inside a hook
- check, if any “add_action” function contains string XXXXXXXXX
- Remove action added from class
- Hook into ‘when user logs in’ [persistent login]
- Custom registration field to SQL database
- Updating User Profile on Registration
- Is this correct usage of filters in WordPress [closed]
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- can’t output gray scaled image I’ve created using add_image_size
- ACF Load Field Groups Programmatically [closed]
- Conditionally including JS based on whether ACF field is set [closed]
- Add a filter conditionally based on frontpage
- Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields