logo Online Learner
  • Home
  • Learning Paths
  • Development
    Frontend Development Backend Development
  • Study Notes
  • Free Resume Builder
  • About Us
  • Contact Us
  • Login
  • Sign Up
  1. Learning Paths
  2. Next.js Tutorial
  3. Next js Metadata and SEO

Next.js Metadata & SEO

Good Next.js SEO starts with giving search engines and social networks the right information about every page. The App Router includes a built-in Metadata API that generates the correct <head> tags for you, without any extra packages. When you combine that with Server Components, the HTML that reaches a crawler already contains your content and metadata.

This tutorial shows you how to export a static metadata object from a layout, use generateMetadata for dynamic pages, and set up a title template so every page has a consistent suffix. You will also create app/sitemap.ts and app/robots.ts, add JSON-LD structured data safely, and walk through a checklist of on-page SEO basics that every Next.js project should follow.

If you have not worked with dynamic routes yet, read Next.js Dynamic Routes first, because generateMetadata receives the same params object. For image-related SEO, including alt text and Open Graph images, see Next.js Image Optimization.

What Is the Next.js Metadata API?

The Next.js Metadata API is a set of conventions for defining page metadata inside Server Components. You either export a static metadata object or an async generateMetadata function, and Next.js turns the result into the appropriate <head> tags . It replaces the need for a separate next/head component and works only in Server Components.

// app/about/page.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: "About Us",
  description: "Learn about our team and mission.",
};

export default function AboutPage() {
  return <h1>About Us</h1>;
}

Browser shows: The page tab reads About Us, and the page source contains <meta name="description" content="Learn about our team and mission." />. You did not write any <head> tags yourself.

How it works: Next.js reads the exported metadata object at build time (or request time for dynamic pages) and injects the matching tags into the HTML. The object supports many fields: title, description, openGraph, twitter, alternates, robots, and more . Because the export only works in Server Components, the metadata is resolved on the server before the page is sent, which is exactly what crawlers need.

Static Metadata, Title Templates, and Inheritance

Static metadata is an object you export when the values do not depend on request data. A common pattern is to define a title template in the root layout so every child page inherits a consistent suffix .

// app/layout.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: {
    default: "Online Learner",
    template: "%s | Online Learner",
  },
  description: "Free programming tutorials for beginners.",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}
// app/blog/page.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: "Blog",
};

export default function BlogPage() {
  return <h1>Blog</h1>;
}

Browser shows: The blog page tab reads Blog | Online Learner. A page that does not set a title falls back to the default value, Online Learner.

How it works: Metadata flows from the root layout down to child segments. A page's title string is inserted into the parent's template using the %s placeholder. If a page sets no title, the parent's default is used. This inheritance works for other fields too, but title is the most visible benefit. You cannot export both metadata and generateMetadata from the same segment .

Dynamic Metadata with generateMetadata and Awaited Params

generateMetadata is an async function you export from a dynamic page. It receives the same params and searchParams as the page component, and in Next.js 16 both are Promises that must be awaited .

// app/blog/[slug]/page.tsx
import type { Metadata } from "next";

type Post = {
  title: string;
  description: string;
};

type Props = {
  params: Promise<{ slug: string }>;
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { slug } = await params;

  const response = await fetch(`https://jsonplaceholder.typicode.com/posts/${slug}`);
  const post: Post = await response.json();

  return {
    title: post.title,
    description: post.description,
    alternates: {
      canonical: `https://onlinelearner.in/blog/${slug}`,
    },
  };
}

export default async function BlogPostPage({ params }: Props) {
  const { slug } = await params;
  return <h1>Post {slug}</h1>;
}

Browser shows: The tab title matches the post title from the API, the description matches the post body excerpt, and the page source contains a <link rel="canonical" href="https://onlinelearner.in/blog/1" /> tag.

How it works: Next.js calls generateMetadata as part of rendering the page. If the page is prerendered, the metadata is baked into the initial HTML. If the page is dynamic, the metadata may stream in after the UI, but bots that expect metadata in the <head> receive it in the initial response . The alternates.canonical field tells search engines which URL is the preferred version, which prevents duplicate-content issues when the same post is reachable through multiple URLs.

Sitemap and Robots Files

Next.js can generate sitemap.xml and robots.txt from TypeScript files in the app directory. This keeps both files in sync with your routes and database .

app/sitemap.ts

// app/sitemap.ts
import type { MetadataRoute } from "next";

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
  const baseUrl = "https://onlinelearner.in";

  const posts = [
    { slug: "next-js-data-fetching", updatedAt: new Date("2026-01-10") },
    { slug: "next-js-route-handlers-api", updatedAt: new Date("2026-01-12") },
  ];

  return [
    {
      url: baseUrl,
      lastModified: new Date(),
      changeFrequency: "weekly",
      priority: 1,
    },
    ...posts.map((post) => ({
      url: `${baseUrl}/nextjs-tutorial/${post.slug}`,
      lastModified: post.updatedAt,
      changeFrequency: "monthly" as const,
      priority: 0.7,
    })),
  ];
}

Output: Visiting /sitemap.xml returns a valid XML sitemap listing the home page and each tutorial URL, with lastModified dates and changeFrequency hints.

app/robots.ts

// app/robots.ts
import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
  return {
    rules: [
      {
        userAgent: "*",
        allow: "/",
        disallow: ["/api/", "/admin/"],
      },
    ],
    sitemap: "https://onlinelearner.in/sitemap.xml",
    host: "https://onlinelearner.in",
  };
}

Output: Visiting /robots.txt returns rules that allow all crawlers to index the public site, block /api/ and /admin/, and point to the sitemap URL.

How it works: The sitemap.ts file exports a function that returns an array of route objects. Next.js serves the result at /sitemap.xml. The robots.ts file exports a function that returns a rules object, served at /robots.txt. The sitemap field in the robots object tells crawlers where to find your sitemap. Both files can be async if they need to fetch data .

Open Graph Images and JSON-LD Structured Data

Open Graph images control how your links look when shared on social media. You can place an opengraph-image.png file in any route segment, and Next.js adds the appropriate og:image tags automatically .

app/
  blog/
    opengraph-image.png
    opengraph-image.alt.txt
    page.tsx

Output: Sharing a link to /blog on social media shows the image with the alt text from the .txt file. The generated tags include og:image, og:image:width, og:image:height, and og:image:alt.

JSON-LD structured data helps search engines understand the content type. Add it as a <script> tag in a Server Component, and escape < characters in the JSON to prevent injection .

// app/blog/[slug]/page.tsx
export default async function BlogPostPage({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;

  const jsonLd = {
    "@context": "https://schema.org",
    "@type": "BlogPosting",
    headline: "Next.js Data Fetching",
    author: { "@type": "Person", name: "Online Learner" },
  };

  return (
    <article>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(jsonLd).replace(/</g, "\\u003c"),
        }}
      />
      <h1>Post {slug}</h1>
    </article>
  );
}

Output: The page source contains a valid JSON-LD block. Google's Rich Results Test can validate it without errors.

How it works: The dangerouslySetInnerHTML prop is the recommended way to render JSON-LD because the data is not executable JavaScript. The .replace(/</g, "\\u003c") step escapes any < characters, so a string containing </script> cannot close the script tag early. Do not use next/script for JSON-LD; a native script tag is the correct choice .

Why Server Components Help Next.js SEO

Server Components render on the server and send complete HTML to the browser. When a crawler requests your page, it receives the content immediately, without waiting for JavaScript to download and run. This makes your pages easier to index and improves the accuracy of how search engines understand your content .

The Metadata API also only works in Server Components, which means your titles and descriptions are resolved on the server and included in the initial response. For dynamic pages, Next.js is careful to send metadata in the <head> for crawlers that need it, even when it streams the UI for regular users.

On-Page SEO Checklist

This table summarizes the basics every Next.js page should have. Use it as a quick audit before launching a project.

Check What to do Where
Unique title Every page needs a distinct title; use a template for the suffix metadata or generateMetadata
Unique description Write a specific description for each page, not a copy of the title metadata or generateMetadata
Headings One <h1> per page, use <h2> and <h3> for structure Page component
Canonical URL Set alternates.canonical on dynamic pages to avoid duplicates generateMetadata
Sitemap List all public pages with lastModified dates app/sitemap.ts
Robots Allow public pages and block private paths app/robots.ts

Common Mistakes and Best Practices

  • Forgetting to await params in generateMetadata. In Next.js 16, params is a Promise. Accessing params.slug directly gives you a warning and undefined, so your title becomes undefined | Site Name .
  • Exporting both metadata and generateMetadata from the same file. Next.js does not know which one to use and reports a build error. Pick one. Use metadata for static values and generateMetadata for dynamic ones .
  • Reusing the same description on every page. Search engines may ignore duplicate descriptions or pick their own text. Write a specific description for each page, even if it is short.
  • Forgetting to escape < in JSON-LD. A string containing </script> can break the page or create an XSS vulnerability. Always replace < with \\u003c after JSON.stringify .
  • Blocking CSS or JS in robots.txt. Search engines need these files to render your page correctly. Blocking /_next/ can prevent Google from seeing your styled content. Only block paths that contain private data, like /api/ and /admin/.
  • Setting openGraph.images and also placing an opengraph-image file. The explicit openGraph.images value overrides the file. Pick one approach per route to avoid confusion .

Real-World Example: A Tutorial Page with Full Metadata

This example combines a root layout with a title template, a dynamic tutorial page with generateMetadata and JSON-LD, a sitemap, and a robots file.

// app/layout.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: {
    default: "Online Learner",
    template: "%s | Online Learner",
  },
  description: "Free programming tutorials for beginners.",
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}
// app/nextjs-tutorial/[slug]/page.tsx
import type { Metadata } from "next";

type Tutorial = {
  title: string;
  description: string;
};

type Props = {
  params: Promise<{ slug: string }>;
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { slug } = await params;

  const tutorials: Record<string, Tutorial> = {
    "next-js-data-fetching": {
      title: "Next.js Data Fetching",
      description: "Learn how to fetch data in async Server Components.",
    },
  };

  const tutorial = tutorials[slug] ?? {
    title: "Tutorial Not Found",
    description: "This tutorial does not exist.",
  };

  return {
    title: tutorial.title,
    description: tutorial.description,
    alternates: {
      canonical: `https://onlinelearner.in/nextjs-tutorial/${slug}`,
    },
  };
}

export default async function TutorialPage({ params }: Props) {
  const { slug } = await params;
  const jsonLd = {
    "@context": "https://schema.org",
    "@type": "TechArticle",
    headline: "Next.js Data Fetching",
  };

  return (
    <article>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(jsonLd).replace(/</g, "\\u003c"),
        }}
      />
      <h1>{slug}</h1>
    </article>
  );
}

Line-by-line explanation:

  • The root layout sets a title.template with %s | Online Learner. Any child page that exports a string title gets this suffix automatically.
  • The dynamic page exports generateMetadata, which awaits params and returns a Metadata object with title, description, and alternates.canonical.
  • The canonical URL tells search engines that https://onlinelearner.in/nextjs-tutorial/next-js-data-fetching is the preferred version of the page.
  • The page component renders a JSON-LD script with dangerouslySetInnerHTML and the .replace(/</g, "\\u003c") safety step.
  • In a real project, the sitemap and robots files from earlier sections complete the setup.

Summary

  • Next.js SEO starts with the Metadata API: export a metadata object for static pages or generateMetadata for dynamic pages.
  • Use a title.template in the root layout to give every page a consistent suffix, and set alternates.canonical on dynamic routes.
  • Create app/sitemap.ts and app/robots.ts to tell search engines what to crawl and where to find your pages.
  • Add JSON-LD with a native <script> tag and escape < characters to prevent injection.
  • Server Components deliver complete HTML to crawlers, which makes your content easier to index.
  • Follow the on-page checklist: unique titles, unique descriptions, proper headings, canonical URLs, a sitemap, and a robots file.

Now that your pages are search-friendly, the next step is styling them efficiently. Continue with Tailwind CSS with Next.js.

Frequently Asked Questions

Can I use generateMetadata in a Client Component?

No. The metadata object and generateMetadata function are only supported in Server Components. If you have a Client Component page, create a sibling layout.tsx that is a Server Component and export the metadata there. This keeps the metadata on the server while your interactive page remains a Client Component.

What happens if I don't set a title for a page?

The page inherits the nearest parent's title. If the root layout has a title.default, that value is used. If no parent sets a title, Next.js falls back to the route segment name or a generic value. It is best to set a meaningful title on every page, even if it relies on a template for the suffix.

How do I prevent a page from appearing in search results?

Export a metadata object with robots: { index: false, follow: false }. This adds a noindex, nofollow meta tag to the page. You can also disallow the path in robots.ts, but the meta tag is more reliable because it applies even if the page is linked from elsewhere.

Do I need both sitemap.ts and robots.ts?

They serve different purposes. sitemap.ts lists your public URLs so search engines can discover them. robots.ts tells crawlers which paths they may or may not visit, and points to the sitemap. You can have a sitemap without a robots file, but adding both gives you full control over crawling.

Why is my JSON-LD not showing up in Google's Rich Results Test?

Check three things: the script type must be application/ld+json, the JSON must be valid after the .replace(/</g, "\\u003c") step, and the script must be inside the page's rendered HTML. Use your browser's "View Page Source" to confirm the script is present. If you used next/script instead of a native script tag, it may not render correctly for structured data.

Practice Exercises

Easy: Add a static title and description

Create a page at app/contact/page.tsx with a static metadata export that sets the title to Contact Us and the description to Get in touch with our team.

Show solution
// app/contact/page.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: "Contact Us",
  description: "Get in touch with our team.",
};

export default function ContactPage() {
  return <h1>Contact Us</h1>;
}

The metadata object is exported from a Server Component and Next.js generates the <head> tags automatically.

Easy: Set up a title template

Update the root layout to use a title template where child page titles appear as [Page Title] | My Site.

Show solution
// app/layout.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: {
    default: "My Site",
    template: "%s | My Site",
  },
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

Child pages that export a string title get the template applied automatically.

Medium: Add generateMetadata to a dynamic route

Create a dynamic page at app/products/[id]/page.tsx. Use generateMetadata to await params and return a title that includes the product ID.

Show solution
// app/products/[id]/page.tsx
import type { Metadata } from "next";

type Props = {
  params: Promise<{ id: string }>;
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { id } = await params;
  return {
    title: `Product ${id}`,
    description: `Details for product ${id}.`,
  };
}

export default async function ProductPage({ params }: Props) {
  const { id } = await params;
  return <h1>Product {id}</h1>;
}

The params Promise is awaited before reading id, which is required in Next.js 16.

Challenge: Create sitemap.ts and robots.ts

Add a sitemap.ts that lists the home page and a /about page, and a robots.ts that allows all crawlers and points to the sitemap.

Show solution
// app/sitemap.ts
import type { MetadataRoute } from "next";

export default function sitemap(): MetadataRoute.Sitemap {
  const baseUrl = "https://example.com";
  return [
    { url: baseUrl, lastModified: new Date(), priority: 1 },
    { url: `${baseUrl}/about`, lastModified: new Date(), priority: 0.8 },
  ];
}
// app/robots.ts
import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
  return {
    rules: [{ userAgent: "*", allow: "/" }],
    sitemap: "https://example.com/sitemap.xml",
  };
}

Next.js serves sitemap.ts at /sitemap.xml and robots.ts at /robots.txt automatically.



Shaikh Abdul Shahid
Written by Shaikh Abdul Shahid

A Full-Stack Developer with experience in PHP, Laravel, JavaScript, and React.
Founder of Online Learner, sharing practical knowledge and programming tutorials.
Building and maintaining real-world web applications since 2017.

GitLab LinkedIn
X
0 likes
Your Feedback

Help us improve by sharing your thoughts.

IT and Digital Marketing
keyboard_arrow_left Previous
Next keyboard_arrow_right
Online Learner Logo

Online Learner helps developers master programming, database concepts, interview preparation, and real-world implementation through structured learning paths.

Quick Links

  • Frontend Development
  • Backend Development
  • Learning Paths
  • Notes
  • Free Resume Builder
  • Portfolio

Company

  • About Us
  • Contact Us
  • Terms & Conditions
  • Disclaimer

© 2023 - 2026 OnlineLearner.in | All Rights Reserved.

logo
  • code Frontend
  • storage Backend
  • live_help Interviews
  • work_outline PHP Frameworks
  • settings Routine Use
  • book Blogs
Frontend
  • HTML Tutorial
    • HTML Introduction
    • HTML Tags
    • HTML Elements
    • HTML Attributes
    • HTML Heading
    • HTML Paragraph
    • HTML Formatting
    • HTML Quotations
    • HTML Comments
    • HTML Styles
    • HTML Color
    • HTML CSS
    • HTML Images
    • HTML Favicon
    • HTML Links
    • HTML DIV
    • HTML Tables
    • HTML Table Size
    • HTML Table Head
    • Table Padding & Spa...
    • Table colspan rowspsn
    • HTML Table Styling
    • HTML Colgroup
    • HTML List
    • HTML Block & Inline
    • HTML Classes
    • HTML Id
    • HTML Iframes
    • HTML Head
    • HTML Layout
    • HTML Semantic Elements
    • HTML Style Guide
    • HTML Forms
    • HTML Form Attribute
    • HTML Form Element
    • HTML input type
    • HTML Computer code
    • HTML Entity
    • HTML Symbol
    • HTML Emojis
    • HTML Charset
    • HTML Input Form Att...
    • HTML URL Encoding
  • CSS Tutorial
    • CSS Introduction
    • CSS Syntax
    • CSS Selector
    • How To Add CSS
    • CSS Comments
    • CSS Colors
    • CSS Background color
    • CSS background-image
    • CSS Borders
    • CSS Margins
    • CSS Height, Width a...
    • CSS Box Model
    • CSS Outline
    • CSS Text
    • CSS Fonts
    • CSS Icon
    • CSS Links
    • CSS Tables
    • CSS Display
    • CSS Maximum Width
    • CSS Position
    • z-index Property
  • JavaScript Tutorial
    • What is JavaScript
    • JS Syntax
    • JS Variables
    • JS Data Types
    • JS Operators
    • JS Control Flow - IF
    • JS Control Flow - S...
    • JS Control Flow - Loop
    • JS Function
    • JS Object Methods
    • JS Anonymous Funct...
    • JS Recursive Function
    • JS Default Parameters
    • JS this Keyword
    • What is an Array in...
    • What are JavaScript...
    • Error Handling in J...
    • DOM Selection in Ja...
    • DOM Traversal in Ja...
    • Manipulating Elemen...
    • Event Handling in J...
    • JavaScript Event Li...
    • JavaScript Event Pr...
    • Form Handling in Ja...
    • Dynamic Styling in ...
    • JavaScript DOM Elem...
    • Window Object in Ja...
    • What is Local Storage?
    • Regular Expressions...
  • Jquery Tutorial
    • What is jQuery?
    • Benefits of using j...
    • Include jQuery
    • Selectors.
    • Methods.
    • The $ symbol and sh...
    • Selecting elements
    • Getting and setting...
    • Adding and removing...
    • Modifying CSS and c...
    • Binding and Unbindi...
    • Common events: clic...
    • Event delegation
    • Using .on() for dyn...
    • Showing and hiding ...
    • Fading elements in ...
    • Sliding elements up...
    • .animate()
    • Understanding AJAX
    • .ajax()
    • .load(), .get(), .p...
    • Handling responses ...
    • Parent
    • Chlid
    • Siblings
    • Filtering Elements
    • Using find
    • Selecting form elem...
    • Getting form values
    • Setting form values
    • Form validation
    • Handling form submi...
    • jQuery plugins
    • Sliders plugins
    • $.each()
    • $.trim()
    • $.extend()
    • Data attributes
    • Debugging jQuery code
  • Bootstrap 4
    • What is Bootstrap
    • Benefits of using
    • Setting up
    • Container
    • Row and Column
    • Grid Classes
    • Breakpoints
    • Offsetting Columns
    • Column Ordering
    • Basic Typography
    • Text Alignment
    • Text colors
    • Backgrounds
    • Display
    • Font Size Utilities
    • Buttons
    • Navs and Navbar
    • Forms
    • Cards
    • Alerts
    • Badges
    • Progress Bars
    • Margin
    • Padding
    • Sizing
    • Flexbox
    • Dropdowns
    • Modals
    • Tooltips
    • Popovers
    • Collapse
    • Carousel
    • Images
    • Tables
    • Jumbotron
    • Media Object
  • Git
    • Understanding Versi...
    • Download and Instal...
    • Git Configure
    • Git Initialize
    • Add Changes to Staging
    • Commit Changes
    • Branching
    • Merging
    • Remote Repository
    • Understanding Git C...
    • Stashing Changes
    • Viewing Commit History
    • Undoing Changes
  • Ajax Tutorial
    • Ajax Fundamentals
    • Ajax Working
    • XMLHttpRequest Fetch
    • Synchronous vs Asyn...
    • Ajax Advantages
    • Ajax Disadvantages
    • $.ajax() method
    • Ajax GET request
    • Ajax POST Request
    • Json Response
    • Ajax Errors
    • Ajax Form
  • React Tutorial
    • What is React? Begi...
    • React Environment S...
    • React Fundamentals:...
    • Functional vs Class...
    • Props in React Expl...
    • State and setState ...
    • React Event Handling
    • React Conditional R...
    • React Lists and Keys
    • Styling in React In...
    • Styling in React Us...
    • Styling in React Us...
    • Tailwind CSS with R...
    • Tailwind vs CSS Mod...
    • React Hooks
    • React useState Hook
    • React useEffect Hook
    • React useRef Hook
    • React useContext Hook
    • React useReducer Hook
    • Custom Hooks in React
    • React Router – In...
    • Installing React Ro...
    • React Router – Ro...
    • React Router – Ne...
    • React Router URL Pa...
    • React Router Protec...
    • React Router Redire...
    • State Management in...
    • Redux State Managem...
    • Redux Toolkit Expla...
    • Redux Toolkit vs Re...
    • Controlled vs Uncon...
    • Handling Form Input...
    • API Integration in ...
    • Axios in React – ...
    • Handling Loading an...
    • Async Await in Java...
    • Displaying API Data...
    • CRUD Operations in ...
    • React Performance O...
    • React Performance O...
  • Tailwind
    • Introduction to Tai...
    • Utility-First CSS E...
    • Tailwind CSS vs Boo...
    • When and Why to Use...
    • Real-World Use Case...
    • Tailwind CSS Instal...
    • Installing Tailwind...
    • Tailwind CSS with V...
    • Setting Up Tailwind...
    • Install Tailwind CS...
    • Tailwind CSS Colors...
    • Tailwind CSS Backgr...
    • Tailwind CSS Paddin...
    • Tailwind CSS Margin...
    • Tailwind CSS Width ...
    • Tailwind CSS Height...
    • Tailwind CSS Border...
    • Tailwind CSS Border...
    • Tailwind CSS Text S...
    • Tailwind CSS Box Sh...
    • Tailwind CSS Opacit...
    • Tailwind CSS Cursor...
    • Tailwind CSS Overfl...
    • Tailwind CSS Font S...
    • Tailwind CSS Font W...
    • Tailwind CSS Text A...
    • Tailwind CSS Line H...
    • Tailwind CSS Letter...
    • Tailwind CSS Text T...
    • How to Use Google F...
    • Flexbox with Tailwi...
    • Justify Content in ...
    • Align Items in Tail...
    • Flex Direction in T...
    • Gap in Tailwind CSS...
    • Flexbox with Tailwi...
    • Grid System in Tail...
    • Grid System in Tail...
    • Responsive Design i...
    • Positioning & Z-Ind...
    • Background Colors i...
    • Background Images i...
    • Gradients in Tailwi...
    • Image Object-Fit in...
    • Image Overlay Effec...
    • Buttons in Tailwind...
    • Hover & Focus State...
    • Buttons and Forms i...
    • Cards and Sections ...
    • Navbar and Footer D...
  • TypeScript Tutorial
    • TypeScript Introduc...
    • TypeScript Installa...
    • First TypeScript Pr...
    • TypeScript Basic Types
    • Type Inference and ...
    • TypeScript Arrays a...
    • TypeScript Enums
    • TypeScript Any, Unk...
    • TypeScript Interfaces
    • Type Aliases and Un...
    • Intersection Types
    • Literal Types
    • Functions in TypeSc...
    • Classes in TypeScript
    • Access Modifiers an...
    • Abstract Classes
    • TypeScript Generics
    • TypeScript Utility ...
    • Type Guards and Nar...
    • Modules and Namespaces
    • TypeScript Decorators
    • TypeScript with React
    • TypeScript with Nod...
  • Next.js Tutorial
    • Introduction to Nex...
    • Next js Setup and P...
    • Next js App Router ...
    • Next js Pages and L...
    • Next js Navigation ...
    • Next js Dynamic Routes
    • Next js Route Groups
    • Next js Middleware
    • Server vs Client Co...
    • SSR, SSG and ISR Ex...
    • Next js Loading and...
    • Next js Data Fetching
    • Next js Route Handl...
    • Next js Forms and S...
    • Next js Caching and...
    • Next js Image Optim...
    • Next js Metadata an...
    • Tailwind CSS with N...
    • Next js Authentication
    • Next js Database wi...
Backend
  • PHP Tutorial
    • PHP Introduction
    • PHP Installation
    • PHP Syntax
    • PHP Comments
    • PHP Variable
    • PHP Echo
    • PHP Data Types
    • PHP Strings
    • PHP Constant
    • PHP Maths
    • PHP Number
    • PHP Operators
    • PHP if else & if el...
    • PHP Switch
    • PHP Loops
    • PHP Functions
    • PHP Array
    • PHP OOps
    • PHP Class & Object
    • PHP Constructor
    • PHP Destructor
    • PHP Access Modfiers
    • PHP Inheritance
    • PHP Final Keyword
    • PHP Class Constant
    • PHP Abstract Class
    • PHP Superglobals
    • PHP Regular Expression
    • PHP Interfaces
    • PHP Static Method
    • PHP Static Properties
    • PHP Namespace
    • PHP Iterable
    • PHP Form Introduction
    • PHP Form Validation
    • PHP Complete Form
    • PHP Date and Time
    • PHP Include Files
    • PHP - Files & I/O
    • File Upload
    • PHP Cookies
    • PHP SESSION
    • PHP Filters
    • PHP Callback Functions
    • PHP JSON
    • PHP AND Exceptions
    • PHP Connect database
  • PHP Functions
    • strlen
    • strtoupper
    • strtolower
    • ucfirst
    • ucwords
    • substr
    • str_replace
    • strpos
    • trim in php
    • explode
    • implode
    • count in php
    • array_merge
    • array_push
    • array_pop
    • array_shift
    • array_unshift
    • in_array
    • array_keys
    • array_values
    • array_filter
    • array_map
    • sort
    • asort
    • ksort
    • abs
    • round
    • ceil
    • floor
    • rand
    • mt_rand
    • max
    • min
    • pow
    • sqrt
    • date
    • time
    • strtotime
    • mktime
    • date_diff
    • getdate
    • fopen
    • fread
    • fwrite
    • fclose
    • file_get_contents
    • file_put_contents
    • file_exists
    • unlink
    • filesize
    • is_readable
    • is_writable
    • urlencode
    • urldecode
    • parse_url
    • http_build_query
    • isset
    • empty
    • is_numeric
    • is_array
    • is_string
    • filter_var
    • htmlspecialchars
    • md5
    • sha1
    • password_hash
    • password_verify
    • die
    • exit
    • var_dump
    • print_r
    • include
    • require
    • json_encode
    • json_decode
    • sleep
  • PHP and MySQL Functions
    • mysqli_connect
    • mysqli_select_db
    • mysqli_query
    • mysqli_prepare
    • mysqli_stmt_execute
    • mysqli_multi_query
    • mysqli_fetch_assoc
    • mysqli_fetch_array
    • mysqli_fetch_row
    • mysqli_fetch_object
    • mysqli_num_rows
    • mysqli_real_escape_...
    • mysqli_insert_id
    • mysqli_affected_rows
    • mysqli_error
    • mysqli_close
    • mysqli_commit
    • mysqli_rollback
  • Python Tutorial
    • What is Python?
    • Install Python on W...
    • Install Python on L...
    • Install Python on m...
    • IDE Setup
    • Python syntax
    • Python Comments
    • Python Indentation
    • Python Variables
    • Python Data Types
    • Python Numeric
    • Python Boolean
    • Python String
    • Python List
    • Python Tuple
    • Python Range
    • Python Dictionary
    • Python Arithmetic O...
    • Python Assignment O...
    • Python Comparison O...
    • Python Logical Oper...
    • Python Bitwise Oper...
    • Python if condition
    • Python if else cond...
    • Python For Loop
    • Python While Loop
    • Python break, conti...
  • MYSQL
    • SQL Introduction
    • Syntax
    • Select statement
    • Select Distinct
    • WHERE Clause
    • Order By
    • SQL AND Operator
    • SQL OR Operator
    • SQL NOT Operator
    • SQL LIKE
    • SQL IN
    • SQL BETWEEN
    • SQL INSERT INTO
    • SQL NULL Values
    • SQL UPDATE
    • SQL DELETE
    • SQL TOP, LIMIT, FET...
    • SQL MIN() and MAX()...
    • SQL COUNT() Function
    • SQL SUM()
    • SQL AVG()
    • SQL Aliases
    • SQL JOIN
    • SQL INNER JOIN
    • SQL LEFT JOIN
    • SQL RIGHT JOIN
    • SQL FULL OUTER JOIN
    • SQL Self Join
    • SQL UNION
    • SQL GROUP BY
    • SQL HAVING
    • SQL EXISTS
    • SQL ANY and ALL
    • SQL SELECT INTO
    • SQL INSERT INTO SELECT
    • SQL CASE
    • SQL NULL Functions
    • SQL Stored Procedures
    • SQL Comments
    • SQL Operators
    • SQL CREATE DATABASE
    • SQL DROP DATABASE
    • SQL BACKUP DATABASE
    • SQL CREATE TABLE
    • SQL DROP TABLE
    • SQL ALTER TABLE
    • SQL Constraints
    • SQL NOT NULL
    • SQL UNIQUE Constraint
    • SQL PRIMARY KEY
    • SQL FOREIGN KEY
    • SQL CHECK Constraint
    • SQL CREATE INDEX
    • SQL AUTO INCREMENT
    • SQL Dates
    • SQL Views
    • SQL Injection
    • SQL Hosting
    • SQL Data Types
  • Node Js
    • What is Node.js?
    • Why use Node.js?
    • Installing Node.js
    • First Node.js progr...
    • Event Loop
    • Understanding npm
    • What are Modules?
    • fs (File System)
    • Http Module
    • Path Module
    • Creating custom mod...
    • Exporting and impor...
    • Setting up a basic ...
    • Handling requests a...
    • Serving HTML
    • Serving CSS
    • Serving JavaScript
  • Python MySQL
    • Database Connection
    • Table Creation
    • Insert Query
    • Select Query
    • Update Query
    • Delete Query
    • Where Clause Query
    • Limit Clause Query
    • Join Tables
    • Order By Query
    • Group By Query
    • Aggregate Functions
    • Parameterized Query
  • Java Tutorials
    • Java Introduction
    • Java Installation
    • Java Syntax
    • Java Comments
    • Java Variables
    • Java DataTypes
    • Java Operators
    • Java Conditionals
    • Java Looping
    • Java Arrays
    • Java Methods
    • Java Classes
    • Java Objects
    • Java Constructors
    • Java Inheritance
    • Java Polymorphism
    • Java Encapsulation
    • Java Abstraction
    • Java Exception
    • Java Interfaces
    • Java File Handling
    • Java Threads
    • Java Access Modifiers
    • Java Static Keyword
    • Java Final Keyword
    • Java Nested Class
    • Java Synchronization
  • Docker
    • Introduction to Docker
    • Installing Docker
    • Docker Architecture
    • Docker Images
    • Docker Containers
    • Dockerfile Basics
    • Docker Volumes
    • Docker Networking
    • Docker Compose
    • Docker Hub & Registry
    • Multi-Stage Builds
    • Docker with Nginx
    • Docker with MySQL
    • Docker with PHP & L...
    • Docker Environment ...
    • Docker Logs & Debug...
    • Docker Security Bes...
    • Docker Swarm Basics
    • Docker vs Virtual M...
    • Real World Docker P...
Interviews
  • PHP Interviews
    • What is PHP?
    • What does PHP stand...
    • PHP Advantages
    • Difference between ...
    • Start a PHP script?
    • Commenting in PHP
    • Variable in PHP
    • Different types of ...
    • Different types of ...
    • Array in PHP
    • Difference between ...
    • Retrieve data from ...
    • PHP handle errors
    • Sessions in PHP
    • PHP Cookie
    • What are the main f...
    • What are the differ...
    • What are the differ...
  • Java Interview Questions
    • Java Basics – Wha...
    • What is the differe...
    • What are the OOP co...
    • Why is the main met...
    • What are the differ...
    • What is the differe...
    • What is Method Over...
    • What is the Differe...
    • What is the Constru...
    • What are the Access...
    • What is the this Ke...
    • What is the super K...
    • What is the static ...
    • What is the final K...
    • What is Exception H...
    • What are Checked an...
    • What is the Differe...
    • What are Multithrea...
    • What is the Java Co...
    • What is the Differe...
    • What is the Differe...
    • What is the Differe...
    • What is the Differe...
    • How Does HashMap Wo...
    • What is the Differe...
    • What is the Differe...
    • What is the String ...
    • What is the Differe...
    • What is Garbage Col...
    • What is the Differe...
    • What is a Lambda Ex...
    • What is the Stream ...
    • What are Optional C...
    • What is the Differe...
    • What are the Key Fe...
    • What is the Record ...
  • React Interviews
    • What is React.js
    • Help In Interviews
    • Features of React
    • What is JSX
    • React's Virtual DOM
    • State and Props
    • React handle data b...
    • React Component
    • setState() method.
    • Controlled Components
    • Lifecycle Methods
    • Significance of keys
    • What are the differ...
  • Laravel Interviews
    • What is Laravel?
    • What are the key fe...
    • Explain the concept...
    • What is a controlle...
    • What is Blade templ...
    • How does Eloquent O...
    • Explain the concept...
    • What are middleware...
    • How do you create a...
    • What is CSRF protec...
    • What is the purpose...
    • What is the purpose...
    • Explain the concept...
    • How do you create a...
    • What is the purpose...
    • How do you define r...
    • What are named rout...
    • Explain the use of ...
    • What is the purpose...
    • What are service pr...
  • SQL Interviews
    • What is SQL?
    • What are the differ...
    • What is the differe...
    • What is a primary key?
    • What is a foreign key?
    • What are the differ...
    • What is the differe...
    • What is the use of ...
    • What is the differe...
    • What is an index in...
    • What types of index...
    • What is a subquery?
    • How do you use the ...
    • How can you find th...
    • Explain the use of ...
    • What is a view?
    • What are the limita...
    • Write a query to fe...
    • Write a query to fe...
    • Write a query to co...
    • Write a query to fe...
    • Write a query to fe...
    • Write a query to fi...
    • Write a query to fe...
    • Write a query to re...
    • Write a query to ge...
    • Write a query to ge...
    • Write a query to li...
    • Write a query to fi...
    • Write a query to fi...
    • Write a query to ge...
    • Write a query to fi...
    • Write a query to co...
    • Write a query to fi...
    • Write a query to li...
    • Write a query to fe...
    • Write a query to fi...
    • Write a query to fe...
    • Write a query to ge...
    • Write a query to co...
    • Write a query to fe...
  • JavaScript Interview Questions
    • What Exactly is Jav...
    • What are the data t...
    • What is the differe...
    • JavaScript double e...
    • What is a Closure i...
    • What is Hoisting in...
    • Understanding "this...
    • What Are JavaScript...
    • Null vs Undefined i...
    • How Does JavaScript...
    • What is a Promise i...
    • Async/Await in Java...
    • Event Delegation in...
    • JavaScript Modules ...
    • How to Prevent a Fu...
    • JavaScript Intervie...
    • JavaScript Intervie...
    • What is bind() in J...
    • Event Bubbling vs. ...
    • Deep Copy vs Shallo...
    • What is the new Key...
PHP Frameworks
  • Laravel
    • Laravel Topics
    • Laravel 7 Installation
    • Install laravel 8
    • Laravel 8 Routing
    • Laravel Controllers
    • Views and Blade lar...
    • Database and Eloque...
    • Authentication and ...
    • CSRF Protection
    • Laravel Model
    • Database: Query Bui...
Routine Use
  • Linux
    • How to Delete a Fil...
    • Install lemp in ubu...
    • How to check packag...
    • Navigating the File...
    • Managing Files and ...
    • Viewing and Editing...
    • Managing Processes ...
    • Scheduling Tasks wi...
    • Disk Usage Analysis...
    • File and Directory ...
Blogs
  • Blogs
    • Free Hosting on AWS...
    • PHP 8.6 Partial Fun...
    • What is SEO?
    • Zoho Free Mail
    • Speed Up Your Appli...
    • What is a JavaScrip...
    • Laravel vs Lumen: T...
    • MySQL vs PostgreSQL...
    • Automate Free MySQL...
    • How to Use Google A...
    • What is n8n?
    • Cloud Platform Comp...
    • Top Common Mistakes...
    • PHP 8.5: The Pipeli...
    • Google Antigravity ...
    • How to Optimize Que...
    • React vs Angular vs...
    • Base44: Features, P...
    • Difference Between ...
    • HTTP Status Codes E...
    • Build Native Mobile...
    • Top 10 JavaScript F...
    • JIRA, Waterfall, an...
    • WebSockets in Moder...
    • A Complete Real-Wor...
    • Why Developers Shou...
    • Service-Based Compa...
    • Bootstrap vs Tailwi...
    • Direct Prompt vs St...
    • Top 25 SEO HTML Tag...
    • Docker Commands Che...
    • Authentication vs A...
    • Top AI Portals in 2...
    • What is Replit? Com...
    • Laravel 13 Released...
    • NEET Paper Leak Pre...