---
title: "How to Create an Article in Joomla with PHP - Joomla"
description: "Below, you can find a PHP snippet that allows you to create a new article by providing a title, alias, intro, full text, and the category and its stat"
url: "https://www.tassos.gr/docs/joomla/tutorials/create-joomla-article-php"
date: "2026-04-23T15:03:56+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Joomla ](https://www.tassos.gr/index.php?option=com_content&view=category&id=91) / [ Tutorials ](https://www.tassos.gr/index.php?option=com_content&view=category&id=92)

#  How to Create an Article in Joomla with PHP

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Below, you can find a PHP snippet that allows you to create a new article by providing a title, alias, intro, full text, and the category and its state.

 ```
$app = \Joomla\CMS\Factory::getApplication();
$mvcFactory = $app->bootComponent('com_content')->getMVCFactory();
$articleModel = $mvcFactory->createModel('Article', 'Administrator', ['ignore_request' => true]);

$article = [
    'catid' => 2,
    'alias' => \Joomla\CMS\Filter\OutputFilter::stringURLSafe('A41234My Article Title'),
    'title' => '123My Article Title',
    'introtext' => 'My Article Intro Text',
    'fulltext' => 'My Article Full Text',
    'state' => 1,
	'language' => '*',
];

if (!$articleModel->save($article))
{
    throw new Exception($articleModel->getError());
}

```

 Last updated on Apr 23rd 2025 14:04

## Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://www.tassos.gr"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Home",
            "item": "https://www.tassos.gr/docs"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Joomla",
            "item": "https://www.tassos.gr/docs/joomla"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Tutorials",
            "item": "https://www.tassos.gr/docs/joomla/tutorials"
        },
        {
            "@type": "ListItem",
            "position": 5,
            "name": "How to Create an Article in Joomla with PHP",
            "item": "https://www.tassos.gr/docs/joomla/tutorials/create-joomla-article-php"
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.tassos.gr/docs/joomla/tutorials/create-joomla-article-php"
    },
    "headline": "How to Create an Article in Joomla with PHP",
    "image": {
        "@type": "ImageObject",
        "url": "https://www.tassos.gr/"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Tassos",
        "logo": {
            "@type": "ImageObject",
            "url": "https://www.tassos.gr/https://www.tassos.gr/media/brand/logo-text.png"
        }
    },
    "author": {
        "@type": "Person",
        "name": "Tassos Marinos",
        "url": "https://www.tassos.gr/docs/joomla/tutorials/create-joomla-article-php"
    },
    "datePublished": "2024-11-28T09:49:14+02:00",
    "dateCreated": "2024-11-28T09:49:14+02:00",
    "dateModified": "2025-04-23T14:38:36+03:00"
}
```
