He was a native of San Remo, where his father was president of the Chamber of Commerce, and there he studied the classics and philosophy, after which he entered the Augustinian seminary of Ventimiglia; in 1845, he obtained a doctorate at the University of Genoa and was received into the Royal Academy of Superga, where he remained until 1849. He was ordained in March 1846 and assigned to the parish of St. Siro in his hometown of San Remo. In July 1848, in company with Msgr. Moreno, Bishop of Ivrea, Guglielmo Audisio and the Marquis Birago, he established the daily paper L'Armonia, which soon had a number of distinguished contributors; among them, Rosmini and the Marquis Gustavo Benso di Cavour, brother of Camillo Cavour. Although inspired by principles essentially conservative, L'Armonia was originally somewhat moderate due to the presence of representatives of liberal Catholicism. Throughout 1848 the paper followed the events of the war against Austria while maintaining a patriotic attitude in support of the monarchy and calling priests to their duties as citizens in defense of the country.
Editor of ''L'Armonia''
Margotti preferred to defend Catholic thought with pamphlets in which he did not spare criticism of the ministry and its members. They became the object of witty profiles which were collected in a booklet published under the pseudonym Joseph Mongibello. His polemics caught the attention of Moreno and Audisio, and in 1849 he was offered the job of managing editor of L'Armonia. Margotti's writings combined soundness of philosophy and of theological doctrine with rare purity of style, while his ready ability for reply made him a target of the Sardinian government, which at that moment, in furtherance of its policy of territorial expansion, had entered upon a course of legislation that was hostile to the Church and at variance with the wishes of a great majority of the people. In 1855 a law was passed suppressing thirty-five religious orders. In response, those who voted in favor of the law were excommunicated, although the President of the Council prohibited publication of papal encyclicals, including that relating to the excommunication. The paper was subject to seizure, fines, coerced closure, and other harassment. According to The Tablet, so frequently was the paper prosecuted at that time, that an old Piedmontese soldier was retained on its staff to sign as its responsible editor. It is said that in this capacity the brave fellow passed most of his time in prison. Dom Margotti was at this time threatened by the secret societies, and to avoid assassins he was forced to say Mass at an early hour in some quiet convent chapel and from there make his way furtively to the office of his paper. In January 1856 Margotti was attacked on the streets of Turin by a club-wielding assailant who only desisted when he thought he had killed the priest. In 1859, Cavour suppressed "L'Armonia". This publication was replaced by Il Piemonte; but when the period of agitation passed, L'Armonia reappeared; its name was changed on 25 December 1863, at the wish of Pope Pius IX, and it was called L'Unità Cattolica. Margotti continued to be the object of attacks and of plots, but nothing intimidated him; his journalistic proficiency was eulogized by the British Review in its August 1865 issue. In 1857 Margotti and twenty other priests were elected to the House. Prime Minister Cavour, not wishing any effective parliamentary opposition invalidated the election on the grounds of "abuse of spiritual weapons", by which he referred to their publicizing the excommunications. For a long time, the opinion of Margotti on questions of Catholic interest had the force of oracle for Italian Catholics. The circulation for Unità reached 60,000. If he was not the author of the axiom "nè eletti, nè elettori" — "be neither elector nor elected" — he, more effectually than anyone else, presented its truth to the Catholics, to convince them that, in the face of revolutionary triumphs, it was idle to hope for a successful reaction through parliament. In this he was in accordance with the views of Pius IX, who, in 1868, said to Margotti that Catholics should not go to the ballot-box: "Non si vada alle urne". When Rome fell into the hands of the Italian Government, the scene of controversy shifted there and the influence of Dom Margotti's journal declined. Margotti was foreign to all sense of personal aggrandizement. Pius IX once said, "Margotti never asked me for anything: he was right, for any dignity that I could have conferred upon him would have been inferior to his merits". Giacomo Margotti died in Turin on 6 May 1887, leaving nearly 100,000 lire for charitable purposes. Besides the articles in "L'Unità", Margotti wrote "Il processo di Nepomuceno Nuytz, prof. di Diritto Canonico nella Università di Torino" ; "Considerazioni sulla separazione dello Stato dalla Chiesa in Piemonte" ; "Le vittorie della Chiesa nei primi anni del Pontificato di Pio IX" ; "Memorie per la storia dei nostri tempi" ; "Le consolazioni del S. P. Pio IX".