Today, We want to share with you Angular 9/8 SEO Dynamic Rendering Title and Meta Tags.In this post we will show you Angular SEO: How to Make Search-Friendly Pages, hear for How to Set Dynamic Page Title and Meta Tags in Angular 6 / Angular 7 for SEO we will give you demo and example for implement.In this post, we will learn about How to Add Dynamic Title & Meta Tag Per-View Basis in a Angular App with an example.
Angular 9/8 SEO Dynamic Rendering Title and Meta Tags
There are the Following The simple About Angular 8/9 SEO – Set Dynamic Page Title and Meta Tags in Universal App Full Information With Example and source code.
As I will cover this Post with live Working example to develop Setting Angular Component Title and Meta Tags Dynamically, so the some major files and Directory structures for this example is following below.
Add SEO Tags in Angular 9/8:
src/app/app.component.ts
import { OnInit, Component } from '@angular/core'; import { Title, Meta } from '@angular/platform-browser'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) export class AppComponent implements OnInit { name = 'Angular'; constructor( private titleService: Title, private metaTagService: Meta ) { } ngOnInit() { this.titleService.setTitle("How to Optimize AngularJS for Crawling and Indexing - pakainfo.com"); this.metaTagService.addTags([ { name: 'keywords', content: 'angular seo meta tags, how to add meta tags in angular, angular universal dynamic meta tags, angular universal meta tags, how to set seo meta tags in angular, angular set page title and meta tags, angular meta service example, meta service angular' }, { name: 'robots', content: 'index, follow' }, { name: 'author', content: 'Donald Trump' }, { charset: 'UTF-8' } ]); } }
getTag() in Angular
src/app/app.component.ts
ngOnInit() { this.titleService.setTitle("Angular 9/8 SEO - How to Add Page Title and Meta Tags? - pakainfo.com"); this.metaTagService.addTags([ { name: 'keywords', content: 'angular seo meta tags, how to add meta tags in angular, angular universal dynamic meta tags, angular universal meta tags, how to set seo meta tags in angular, angular set page title and meta tags, angular meta service example, meta service angular' }, { name: 'robots', content: 'index, follow' }, { name: 'author', content: 'Donald Trump' }, { charset: 'UTF-8' } ]); const author = this.metaTagService.getTag('name=author'); console.log(author.content); //Donald Trump }
updateTag() in Angular
src/app/app.component.ts
ngOnInit() { this.titleService.setTitle("simple example of angular 9/8 universal meta tags - pakainfo.com"); this.metaTagService.addTags([ { name: 'keywords', content: 'angular seo meta tags, how to add meta tags in angular, angular universal dynamic meta tags, angular universal meta tags, how to set seo meta tags in angular, angular set page title and meta tags, angular meta service example, meta service angular' }, { name: 'robots', content: 'index, follow' }, { name: 'author', content: 'Donald Trump' }, { charset: 'UTF-8' } ]); this.metaTagService.updateTag({ name: 'author', content: 'Donald Trump' }); }
removeTag() using Angular
src/app/app.component.ts
ngOnInit() { this.titleService.setTitle("example of angular 9/8 universal dynamic meta tags - pakainfo.com"); this.metaTagService.addTags([ { name: 'keywords', content: 'angular seo meta tags, how to add meta tags in angular, angular universal dynamic meta tags, angular universal meta tags, how to set seo meta tags in angular, angular set page title and meta tags, angular meta service example, meta service angular' }, { name: 'robots', content: 'index, follow' }, { name: 'author', content: 'Donald Trump' }, { charset: 'UTF-8' } ]); this.metaTagService.removeTag('name="author"'); }
Angular is an app-design framework and development platform
Web Programming Tutorials Example with Demo
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about Angular 9/8 SEO – How to Add Page Title and Meta Tags?.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.