I have a plugin which generates a page automatically. Is there a way I can add functionality to this plugin which would allow me to set the meta description, keywords, and title for the page? I've looked into SEO plugins like Yoast and AIOSEO but I cannot seem to achieve the desired goal.
Here is the source (UPDATED):
<?php
function wpse_36395_metadesc() {
return 'Your Description';
}
if($city){
$args = array(
'post_title' => $city . " Electrician",
'post_name' => $city . "-electrician",
'post_date' => $_SESSION['cal_startdate'],
'post_content' => $citycontent,
'post_status' => 'publish',
'post_type' => 'page',
'post_parent' => 11192
);
$city_id = wp_insert_post($args);
add_filter( 'wpseo_metadesc', 'wpse_36395_metadesc' );
}
?>
Kind Regards,
Brandon
wp_head
, I suppose - but if you plan on the plugin being compatible with a wide variety of themes, this will likely result in duplicate meta tags...