PHPのシリアル化に問題があります。「」が含まれていると、余分な文字スペースが表示されます。たとえば、6文字の場合は7文字になります。
$episodes_count = sizeof($episode_title);
$episodes = array();
$content = '';
for ($i = 0; $i <= $episodes_count; $i++) {
$title = htmlspecialchars($episode_title[$i], ENT_QUOTES);
$airdate = $episodes_airdates[$i];
$season = $episodes_seasons[$i];
$number = $episodes_numbers[$i];
$plot = $episodes_plot[$i];
// check if empty
if (!empty($title) && !empty($number ) && !empty($plot )) {
$episodes[] = array(
'title' => $title,
'airdate' => $airdate,
'season' => $season,
'number' => $number,
'plot' => $plot,
);
}
}
// Serialized Episodes in case they exist, if not, remove the goal post
if ( sizeof($episodes) > 0 ) {
$content = str_replace("'", '%',serialize($episodes));
}
update_post_meta($post_id, 'episodes', $content);
}