---
title: "How to Create an Article in Joomla with PHP - General"
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/common/tutorials/create-joomla-article-php"
date: "2026-11-22T14:20:57+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/docs) / [ General ](https://www.tassos.gr/docs/common) / [ Joomla tutorials ](https://www.tassos.gr/docs/common/tutorials)

#  How to Create an Article in Joomla with PHP

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 Nov 20th 2026 13:11
