General help

Editing the keyword tag

Picture of David Kimball
Re: Editing the keyword tag

Came looking for the same information and was able to piece the answer together from several different posts.  Putting it here for others who are also wanting to know how to change the meta keywords.

1.  Edit the /lib/outputrenderers.php file.

2.  Search for this line:   $output .= '<meta name="keywords" content=

3. The first keyword is moodle with a comma and some code.  Put in each keyword follow by a comma.

4.  The $this->page->title code is to have the current page's name as a meta keyword for that page.

Here is the final result of my line of code:

$output .= '<meta name="keywords" content="MOS, microsoft office, software training, , microsoft, typing, how to type, job search, ' . $this->page->title . '" />' . "\n";


Average of ratings: Useful (1)
Picture of David Kimball
Re: Editing the keyword tag

Tweaked the code a bit to have the course name as the first keyword as I will name all of my courses with highly searchable keywords:

$output .= '<meta name="keywords" content="' . $this->page->title . ', keyword, keyword, keyword" />' . "\n";

Now to figure out how to get rid of the word "Course" in the page title.

Average of ratings: -