If you need to modify the theme files, it is always recommended to create a child-theme. Because when a theme gets updates, the modified files will be overridden by the new version of files and you’ve to redo the changes previously made. A child theme can modify the layout, styling, and functionality of the parent theme by overriding its files.
In this tutorial, you’ll learn how to modify the Title tag for Wordpress posts. We’ll use document_title_parts filter hook to modify the Title tag. For example, you’ve created a post and assigned it a category Wordpress. For SEO purposes, you want this category to appear in the post title. By following this tutorial you can add single or multiple categories (if assigned) in the page title automatically.