The Shulchan Aruch · Orach Chayim
אורח חיים ע״וOrach Chayim 76
Siman 76 of 697 in Orach Chayim — 8 se'ifim
הלכות קריאת שמעLaws of Reciting Shema· siman 76
Se’if 1א׳
צוֹאָה בַּעֲשָׁשִׁית, מֻתָּר לִקְרוֹת כְּנֶגְדָּהּ אַף עַל פִּי שֶׁרוֹאֶה אוֹתָהּ דָּרַךּ דָּפְנוֹתֶיהָ, מִשּׁוּם דִּבְכִסוּי תָּלָה רַחֲמָנָא, דִּכְתִּיב וְכִסִיתָ אֶת צֵאָתֶךָ, וְהָא מִתְכַּסְיָא.
To Be Careful of Excrement at the Time of the Recitation of the Sh'ma. Containing 8 Se'ifim Excrement [that is seen] through a [glass] lamp - it is permitted to recite in front of it even though one sees it through the [glass] walls [of the lamp] because the Mericful One conditions [it] on being covered, as is written "And you shall cover your excrement" (Deuteronomy 23:14), and here, it is covered.
Se’if 2ב׳
צוֹאָה בְּגוּמָא, מֵנִיחַ סַנְדָּלוֹ עָלֶיהָ וְקוֹרֵא, דַּחֲשִׁיבָה כִּמְכֻסָה, וְכֵיוָן שֶׁאֵין רֵיחַ רַע מַגִּיעַ לוֹ, מֻתָּר. וְהוּא שֶׁלֹּא יְהֵא סַנְדָּלוֹ נוֹגֵעַ בָּהּ.
If there is excrement in a hole, one may place their shoe over it and recite [Sh'ma] for it is considered to be covered, and since there is no bad smell that reaches him, it is permitted. And this is as long as his shoe does not touch it (ie. the excrement).
Se’if 3ג׳
הֶעֱבִירוּ צוֹאָה לְפָנָיו, אָסוּר לִקְרוֹת כְּנֶגְדָּהּ, וּפִי חֲזִיר כְּצוֹאָה עוֹבֶרֶת דָּמִי, אֲפִלּוּ עוֹלֶה מִן הַנָּהָר אֵין הָרְחִיצָה מוֹעֶלֶת לוֹ, דְּהָוֵי כִּגְרָף שֶׁל רְעִי.
If excrement passes in front of a person, it is forbidden to recite [the Recitiation of the Sh'ma] in front of it. And the mouth of a pig is like excrement passing, even if it is coming out of the river, the washing does not help it [such that one can recite the Sh'ma], for it is like a container with excrement.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0