Customize the SEO title of the category.

tran-van

Jan 31st, 2020 12:52 PM

I want to customize the SEO title of the category. Currently the website is not for editing. How to adjust the SEO title of the category?

bobbyiliev

Sep 21st, 2022 11:57 PM

Hi there,

I am just following up on some of the old unanswered questions on the site.

With the current version of Wave, you can change the category SEO data in the following file:

wave/wave/src/Http/Controllers/BlogController.php

The category method contains the SEO data that is passed to each category page:

    public function category($slug){

        $category = Category::where('slug', '=', $slug)->firstOrFail();
        $posts = $category->posts()->orderBy('created_at', 'DESC')->paginate(6);
        $categories = Category::all();

        $seo = [
            'seo_title' => $category->name . '- Blog',
            'seo_description' => $category->name . '- Blog',
        ];

        return view('theme::blog.index', compact('posts', 'category', 'categories', 'seo'));
    }

Best,

Bobby