Blog

  • How to Delete Meta Fields with the WordPress REST API

    As of this writing, it is not possible to delete a meta value using the WordPress REST API. Post meta updates must be communicated while inserting and updating post objects, and the only way to “remove” meta fields is to write blank values over their current values.

    I wrote a free and open-source plugin to provide granular control over post and term meta fields. It lives on Github. The plugin is called Manipulate Meta with the WP API, and it extends the REST API to allow one request to retrieve, update, or delete a meta field independently from a post or term object.

    The instructions are located in the repo’s README.md.

  • Azure External Tables: Please verify that the shards are accessible

    Are you getting this error from Azure SQL Server? Login failed on ServerName.database.windows.net.DatabaseName Please verify that the shards are accessible and that the credential information affiliated with external data source ExternalDataSourceName is correct.

    When I ran into this error while migrating a SQL Server instance to Azure and designing External Tables, it was because the user I specified as the IDENTITY during DATABASE SCOPED CREDENTIAL creation had a different password that the LOGIN of the same name in the Master database.

    Say we create a user in the Master database like this:

    CREATE LOGIN ExternalTableAdministrator WITH PASSWORD = 'Nr26MY4@Q407inLE83[I7L$~5j5UL';

    Later, when creating a database-scoped credential (and specifying this user as the identity), make sure to use the same password:

    CREATE DATABASE SCOPED CREDENTIAL [ExternalTableCred]
        WITH IDENTITY = 'ExternalTableAdministrator',
        SECRET = 'Nr26MY4@Q407inLE83[I7L$~5j5UL';
    GO