<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>codigo php Archives - CNERIS</title>
	<atom:link href="https://cneris.com/es/tag/codigo-php/feed/" rel="self" type="application/rss+xml" />
	<link>https://cneris.com/es/tag/codigo-php/</link>
	<description></description>
	<lastBuildDate>Tue, 03 Dec 2024 20:42:05 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Cómo deshabilitar la REST API en WordPress utilizando código PHP</title>
		<link>https://cneris.com/es/como-deshabilitar-la-rest-api-en-wordpress-utilizando-codigo-php/</link>
					<comments>https://cneris.com/es/como-deshabilitar-la-rest-api-en-wordpress-utilizando-codigo-php/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 03 Dec 2024 20:41:51 +0000</pubDate>
				<category><![CDATA[Seguridad informática]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[codigo php]]></category>
		<category><![CDATA[deshabilitar rest api]]></category>
		<category><![CDATA[rest api]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2718</guid>

					<description><![CDATA[<p>La API REST de WordPress permite que las aplicaciones interactúen con tu sitio de manera remota, pero en ciertos casos, podrías querer deshabilitarla para mejorar la seguridad o limitar el acceso a los datos. Aquí tienes cómo deshabilitar la REST API en WordPress utilizando código PHP: Pasos: Abre el archivo functions.php de tu tema activo [...]</p>
<p>The post <a href="https://cneris.com/es/como-deshabilitar-la-rest-api-en-wordpress-utilizando-codigo-php/">Cómo deshabilitar la REST API en WordPress utilizando código PHP</a> appeared first on <a href="https://cneris.com/es">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>La API REST de WordPress permite que las aplicaciones interactúen con tu sitio de manera remota, pero en ciertos casos, podrías querer deshabilitarla para mejorar la seguridad o limitar el acceso a los datos. Aquí tienes cómo deshabilitar la REST API en WordPress utilizando código PHP:</p>
<p><strong>Pasos:</strong></p>
<ol>
<li>Abre el archivo <code>functions.php</code> de tu tema activo o crea un plugin personalizado para realizar este ajuste.</li>
<li>Agrega el siguiente código PHP para deshabilitar la API REST para usuarios no autenticados:</li>
</ol>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><em>function deshabilitar_rest_api( $access ) {</em><br />
<em>if ( ! is_user_logged_in() ) {</em><br />
<em>return new WP_Error( &#8216;rest_cannot_access&#8217;, __( &#8216;REST API ha sido deshabilitada para usuarios no autenticados.&#8217;, &#8216;tu-texto-de-dominio&#8217; ), array( &#8216;status&#8217; =&gt; 401 ) );</em><br />
<em>}</em><br />
<em>return $access;</em><br />
<em>}</em><br />
<em>add_filter( &#8216;rest_authentication_errors&#8217;, &#8216;deshabilitar_rest_api&#8217; );</em></div>
</div>
<ol start="3">
<li>Guarda los cambios y verifica que los usuarios no autenticados ya no puedan acceder a la API REST.</li>
</ol>
<p>The post <a href="https://cneris.com/es/como-deshabilitar-la-rest-api-en-wordpress-utilizando-codigo-php/">Cómo deshabilitar la REST API en WordPress utilizando código PHP</a> appeared first on <a href="https://cneris.com/es">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/es/como-deshabilitar-la-rest-api-en-wordpress-utilizando-codigo-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
